

Now we can fire up the development server: Let’s test out the functionality of sending a password reset… but first we need to re-initialize our database since we made updates to the User model: This function also requires the use of a template for generating the email with the password reset link: This provides a unique way to generate the token so there is no way that confirming an email address is accidentally processed as a password reset. One of the key differences is the used of a different salt when generating the token. This function should look similar to the send_confirmation_email() function that we created in the Confirming a User’s Email Address blog post. Send_email('Password Reset Requested',, html) Token = password_reset_serializer.dumps(user_email, salt='password-reset-salt'), Password_reset_serializer = URLSafeTimedSerializer(app.config) The route (‘/reset’) will require a helper function to send the email with the link to allow the user to reset their password (defined in …/projects/users/views.py):ĭef send_password_reset_email(user_email): The form for allowing a user to enter their email address is pretty simple (defined in …/project/users/forms.py:Įmail = StringField('Email', validators=) Create a new template for displaying the form.Create a new route for displaying the form and processing the data from the form.As with the previous forms that we’ve created, there are three steps that we’ll need to add a new form: The first step in the password reset process is to collect the user’s email address via a form. There are no new modules to install for this blog post. (ffr_env) $ git checkout -b add_password_reset

Setupīefore starting to make any changes for our user management features, let’s create a new feature branch: We’ll be utilizing the standard steps for implementing forms, as well as the steps for sending emails with unique links that we learned about in previous blog posts on User Registration and Confirming User’s Email Address, respectively.

The user is prompted to enter a new password and they have regained entry to our web application.If their email address has been confirmed, then a email is sent to them with a unique link for them to click on.The user clicks on the ‘forgot my password’ link and is prompted to enter his/her email address.A user forgets their email address, but wants to log in to our web application.

please check again to see if any answers are appropriate and mark them as the solution if they are.In this blog post, I’ll be utilizing a number of concepts that we’ve learning in previous blog post to implement the ability to reset a user’s password via an email link. Our replies but has still not been marked as solved.
