Esempio n. 1
0
 def authenticate(self, environ, identity):
     if not 'login' in identity or not 'password' in identity:
         return None
     account = Account.by_name(identity['login'])
     if account is None:
         return None
     if check_password_hash(account.password, identity['password']):
         return account.name
     return None
Esempio n. 2
0
 def authenticate(self, environ, identity):
     if not 'login' in identity or not 'password' in identity:
         return None
     acc = account.find_one_by('name', identity['login'])
     if acc is None:
         return None
     if check_password_hash(acc['password_hash'], identity['password']):
         return acc['name']
     return None
Esempio n. 3
0
 def authenticate(self, environ, identity):
     if not 'login' in identity or not 'password' in identity:
         return None
     account = Account.by_name(identity['login'])
     if account is None:
         return None
     if check_password_hash(account.password, identity['password']):
         return account.name
     return None