Returning invalid response when user is not authenticated instead of redirecting to login