Added withLogin pre-action filter to protect endpoints that require a login to perform the action