mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -04:00
When the user request a reset password link, the user.state is set to request_password_reset.
Which means the user will only be able to reset their password, and not sign-in. Once the user resets the password the user state is set to active once more. If the link is used a second time they will be redirected to the index page with a message that the link in the email is not longer valid.
This commit is contained in:
@@ -14,6 +14,9 @@ def new_password(token):
|
||||
return redirect(url_for('.forgot_password'))
|
||||
|
||||
user = users_dao.get_user_by_email(email_address=email_address.decode('utf-8'))
|
||||
if user and user.state != 'request_password_reset':
|
||||
flash('The link in the email we sent you has already been used.')
|
||||
return redirect(url_for('.index'))
|
||||
|
||||
form = NewPasswordForm()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user