diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-15 12:08:23 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-24 16:52:48 -0700 |
commit | 0bd654a346936e8cfd25d678836ae538f50d9f17 (patch) | |
tree | a43621343963468bfec52144d2296e69bb7282c1 | |
parent | 9c2c9be79d210155f1b8f299d34029afe3a434ed (diff) | |
download | mediagoblin-0bd654a346936e8cfd25d678836ae538f50d9f17.tar.lz mediagoblin-0bd654a346936e8cfd25d678836ae538f50d9f17.tar.xz mediagoblin-0bd654a346936e8cfd25d678836ae538f50d9f17.zip |
modified check_login function to return None instead of False to be able to have multiple plugins check_login
-rw-r--r-- | mediagoblin/auth/__init__.py | 5 | ||||
-rw-r--r-- | mediagoblin/plugins/basic_auth/__init__.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/mediagoblin/auth/__init__.py b/mediagoblin/auth/__init__.py index 4bbecc16..60cbdb0e 100644 --- a/mediagoblin/auth/__init__.py +++ b/mediagoblin/auth/__init__.py @@ -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): diff --git a/mediagoblin/plugins/basic_auth/__init__.py b/mediagoblin/plugins/basic_auth/__init__.py index f11d255a..219dd456 100644 --- a/mediagoblin/plugins/basic_auth/__init__.py +++ b/mediagoblin/plugins/basic_auth/__init__.py @@ -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): |