Handle user authentication