mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-12 12:00:37 +08:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user