Advertisement
Guest User

Untitled

a guest
Mar 20th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. class AuthenticationController(Controller):
  2.    
  3.     @bolt.post('/authenticate', validator=UserDetails)
  4.     def authenticate_action(self, user_details: UserDetails):
  5.         query = FindUsersByFields()
  6.         user = query(username=user_details.username, password=user_details.password)
  7.        
  8.         if user is None:
  9.             raise AuthenticationError('Username and/or password incorrect')
  10.        
  11.         return self.send(user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement