From: Rodney Ewing Date: Wed, 15 May 2013 19:08:23 +0000 (-0700) Subject: modified check_login function to return None instead of False to be able to have... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0bd654a346936e8cfd25d678836ae538f50d9f17;p=mediagoblin.git modified check_login function to return None instead of False to be able to have multiple plugins check_login --- 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):