modified check_login function to return None instead of False to be able to have multiple plugins check_login
This commit is contained in:
parent
9c2c9be79d
commit
0bd654a346
@ -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):
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user