0

I am using the default Django password reset system, which has the following workflow:

  • User clicks 'reset password' link
  • User enters email on a page
  • User is sent password reset link to address entered in previous step

I would like this to be:

  • User clicks 'reset password' link
  • User is sent password reset link to email used to create user account

I already have the former set up, but I can't find a way to change the password reset function to pull the user email from the user model and use that instead of an email that the user enters. Any ideas?

Cirgue
  • 23
  • 6
  • How will it know to which user it has to send email? This is for reset password, so user is not auth at that point. – Gasanov May 12 '19 at 03:56

1 Answers1

0

Be aware: In order to do what you want, only logged in users should have access to the reset password link.

Said that ...

You can access user in the view being pointed by the password reset link using request.user and of course, the email would be request.user.email.

After that, I think you will have to perform some redirection in order to skip the step in which the user enters the email.

Raydel Miranda
  • 13,825
  • 3
  • 38
  • 60