invalidate password reset tokens when the passwords changes

Check that the previous password is the same as it was when this
password reset request was generated.
This commit is contained in:
Nick Retallack
2015-05-11 21:52:57 -07:00
parent 7884d637c5
commit a0e2037747
2 changed files with 14 additions and 4 deletions
+6 -2
View File
@@ -341,7 +341,7 @@ def send_mail(subject, recipient, template, **context):
mail.send(msg)
def get_token_status(token, serializer, max_age=None):
def get_token_status(token, serializer, max_age=None, return_data=False):
"""Get the status of a token.
:param token: The token to check
@@ -367,7 +367,11 @@ def get_token_status(token, serializer, max_age=None):
user = _datastore.find_user(id=data[0])
expired = expired and (user is not None)
return expired, invalid, user
if return_data:
return expired, invalid, user, data
else:
return expired, invalid, user
def get_identity_attributes(app=None):