Skip to content

Commit

Permalink
Merge pull request authlib#54 from husudosu/master
Browse files Browse the repository at this point in the history
PasswordGrant: syntax error on invalid username fixed
  • Loading branch information
lepture authored Aug 21, 2019
2 parents 2e28796 + db3d369 commit cea3e60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def authenticate_user(self, authorization_code):
class PasswordGrant(grants.ResourceOwnerPasswordCredentialsGrant):
def authenticate_user(self, username, password):
user = User.query.filter_by(username=username).first()
if user.check_password(password):
if user is not None and user.check_password(password):
return user


Expand Down

0 comments on commit cea3e60

Please sign in to comment.