Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password recovery

My client requirement for the password recovery is,

when user enters his email/username, system will email him a unique link. In users email, when the user will click the link,

system will take the user to the change password page. User will type a new password and his password will be changed.

Any idea how to do this??

Right now the change password page is only accessable for the logged in users. How do I let a user in to the page by a external link click?

like image 828
Crime Master Gogo Avatar asked Jan 18 '26 20:01

Crime Master Gogo


2 Answers

This is a kind of a "Password change process":

  • Create a database table with the userId, createDate, closeDate, and a UUID
  • send the mail with a link to your page that has the uuid from the prcoess database table
  • if the user enters the page you check if the process is still open (closeDate is null)
  • user can change password
  • you set the closeDate
like image 137
dknaack Avatar answered Jan 21 '26 10:01

dknaack


First check the user Email IF it exists then send him/her a unique email of the link Example:

link : http:\\www.abc.com\passwordrecovery.aspx?ID="+Guid.NewID()

In this way you will send a unique email to every user also store this ID in the user table so when the user click the link you will be able to verify sender.

On your Password Recovery Page Check the value of Query String variable ID and matched the ID of the user in the database if they are equal then show the password page of the required user.

Hope you understand it.

like image 25
Waqar Janjua Avatar answered Jan 21 '26 11:01

Waqar Janjua



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!