Updated authentication checks in UserController to be aligned