redirects to login page or user profile if unauthorized