def authenticate(email, password):
user = User.get(email=email.lower())
if user_if_enabled(user):
if 'pwd_hash' in user:
if check_password_hash(user['pwd_hash'], password):
if 'auth_token' not in user:
user.update_value('auth_token', auth_token(user))
login_user(user)
return user
return None
评论列表
文章目录