modified check_login function to return None instead of False to be able to have...
authorRodney Ewing <ewing.rj@gmail.com>
Wed, 15 May 2013 19:08:23 +0000 (12:08 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 24 May 2013 23:52:48 +0000 (16:52 -0700)
mediagoblin/auth/__init__.py
mediagoblin/plugins/basic_auth/__init__.py

index 4bbecc16ecb9163fd7baf869a18e82e8245c88bf..60cbdb0ef2c9ab39a23a4bde4785ee7277cddb80 100644 (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):
index f11d255a3e101effd8be8425a8eec2ef22ffc8d7..219dd45634c0fc59cbe436e7b896d040ac3d09e8 100644 (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):