Implements endpoint for user authentication