Example #1
0
 def get_verified_user(cls, username, password):
     (user, memkey, mclient) = cls._get_by_username(username)
     if user:
         if not hashing.valid_pw(username, password, user.password):
             user = None
         elif memkey:
             mclient.set(memkey, user)
     return user
Example #2
0
 def get_verified_user(username, password):
     query = User.gql('WHERE username=:username', username=username)
     user = query.get()
     if user:
         if hashing.valid_pw(username, password, user.password):
             return user