Sends the reset password instructions email for the specified user. :param user: The user to send the instructions to
(user)
| 950 | if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE: |
| 951 | |
| 952 | def send_reset_password_instructions(user): |
| 953 | """Sends the reset password instructions email for the specified user. |
| 954 | |
| 955 | :param user: The user to send the instructions to |
| 956 | """ |
| 957 | token = generate_reset_password_token(user) |
| 958 | reset_link = url_for('browser.reset_password', token=token, |
| 959 | _external=True) |
| 960 | |
| 961 | send_mail(config_value('EMAIL_SUBJECT_PASSWORD_RESET'), user.email, |
| 962 | 'reset_instructions', |
| 963 | user=user, reset_link=reset_link) |
| 964 | |
| 965 | reset_password_instructions_sent.send( |
| 966 | current_app._get_current_object(), |
| 967 | user=user, token=token) |
| 968 | |
| 969 | @blueprint.route("/reset_password", endpoint="forgot_password", |
| 970 | methods=['GET', 'POST']) |