Skip to content

Commit

Permalink
When integrating with other authentication mechanisms (i.e. SSO),
Browse files Browse the repository at this point in the history
some users may not have a populated password field.  Check for
user.password before attempting to verify_password.
  • Loading branch information
pbugni committed Nov 4, 2015
1 parent 188b662 commit 56f0e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flask_user/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def validate(self):
user, user_email = user_manager.find_user_by_email(self.email.data)

# Handle successful authentication
if user and user_manager.verify_password(self.password.data, user):
if user and user.password and user_manager.verify_password(self.password.data, user):
return True # Successful authentication

# Handle unsuccessful authentication
Expand Down

0 comments on commit 56f0e8a

Please sign in to comment.