From 0bd654a346936e8cfd25d678836ae538f50d9f17 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 15 May 2013 12:08:23 -0700 Subject: [PATCH] modified check_login function to return None instead of False to be able to have multiple plugins check_login --- mediagoblin/auth/__init__.py | 5 ++++- 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): -- 2.25.1