diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-23 13:20:13 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-24 16:52:49 -0700 |
commit | 09ae2df4eb6b7384403beb323d757fd0f6a81eba (patch) | |
tree | ed8fafc8b0bb3773610ca2e22816f9e672f4da54 | |
parent | 569873d8f0a4d71ff82ba79436ef8ae464d41163 (diff) | |
download | mediagoblin-09ae2df4eb6b7384403beb323d757fd0f6a81eba.tar.lz mediagoblin-09ae2df4eb6b7384403beb323d757fd0f6a81eba.tar.xz mediagoblin-09ae2df4eb6b7384403beb323d757fd0f6a81eba.zip |
modified basic_auth.check_login to check that the user has a pw_hash first
-rw-r--r-- | mediagoblin/plugins/basic_auth/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mediagoblin/plugins/basic_auth/__init__.py b/mediagoblin/plugins/basic_auth/__init__.py index 74d6b836..d0545627 100644 --- a/mediagoblin/plugins/basic_auth/__init__.py +++ b/mediagoblin/plugins/basic_auth/__init__.py @@ -28,9 +28,10 @@ def setup_plugin(): def check_login(user, password): - result = auth_lib.bcrypt_check_password(password, user.pw_hash) - if result: - return result + if user.pw_hash: + result = auth_lib.bcrypt_check_password(password, user.pw_hash) + if result: + return result return None |