modified check_login function to return None instead of False to be able to have multiple plugins check_login

This commit is contained in:
Rodney Ewing 2013-05-15 12:08:23 -07:00
parent 9c2c9be79d
commit 0bd654a346
2 changed files with 8 additions and 2 deletions

View File

@ -17,7 +17,10 @@ from mediagoblin.tools.pluginapi import hook_handle
def check_login(user, password):
return hook_handle("auth_check_login", user, password)
result = hook_handle("auth_check_login", user, password)
if result:
return result
return False
def get_user(*args):

View File

@ -29,7 +29,10 @@ def setup_plugin():
def check_login(user, password):
return auth_tools.bcrypt_check_password(password, user.pw_hash)
result = auth_tools.bcrypt_check_password(password, user.pw_hash)
if result:
return result
return None
def get_user(login_form):