Alright, so to give you a brief idea, here is how a password reset should work :
-You need another table (password_reset)
The table must have a unique code for the password reset link and a foreign key to your user table.
-Endpoint for user to actually reset the password
The endpoint will receive the unique code which is in the password_reset table
The flow :
- User requested for password reset with his/her email.
- Insert a row on the password_reset table, generate the unique code randomly.
- Send the link to password reset endpoint with the unique code via email or something.
- Ask user for new password on the page and change it on your User model.
- Delete the password_reset row.
Hope it helps