Send user email for password reset

Flow:

  • user enters email address
  • after sending, an email is sent to the user.
  • The email will contain a link that will lead the user to the reset password page.

Now, how do I get a user ID based on an email address and encrypt it? Then what should be connected? For example, I want to get the user ID, and then encrypt it somehow, so that the link does not contain the actual identifier, and this link will lead the user to a page that will have text fields for resetting the password. I am just confused how to do this.

And is this a safe way? In reset password like this?

+2
source share
3

:

PasswordresetRequest :

  • Id: Guid - reset.
  • Accountid: string -
  • : DataTime - , reset

:

  • reset -.
  • PasswordresetRequest .
  • reset .
  • , reset.
  • , . , , 12 , .

.

+14

. , , guid, ( db, , ) , . reset, , db/file/whatever reset. , .

+1

Source: https://habr.com/ru/post/1789111/


All Articles