示例#1
0
 def valid_log_token(username, log_token):
     if username:
         username = username.lower()
         user = User.get_user(username)
         return user and log_token == user.log_token
示例#2
0
 def valid_login(username, password):
     if username:
         username = username.lower()
         user = User.get_user(username)
         if user and bc.hashpw(password, user.password) == user.password:
             return Authentication.create_and_save_log_token(user)