only check password if there is a store_hash
authorRodney Ewing <ewing.rj@gmail.com>
Mon, 8 Jul 2013 23:27:43 +0000 (16:27 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Wed, 10 Jul 2013 17:35:26 +0000 (10:35 -0700)
mediagoblin/plugins/basic_auth/__init__.py

index c16d885544b763ea23b029738785e8687dd2f685..33a554b06fd6caff3f3768f8399002e3b90ea73c 100644 (file)
@@ -59,7 +59,10 @@ def gen_password_hash(raw_pass, extra_salt=None):
 
 
 def check_password(raw_pass, stored_hash, extra_salt=None):
-    return auth_tools.bcrypt_check_password(raw_pass, stored_hash, extra_salt)
+    if stored_hash:
+        return auth_tools.bcrypt_check_password(raw_pass,
+                                                stored_hash, extra_salt)
+    return None
 
 
 def auth():