zznicole / shopping-list

Ourshoppinglist is a Mobile-first Web application project. It was created by a team of two developers, using modern Javascript, ES6, React.js,Node.js DBOO database, Material UI, Arios......
0 stars 0 forks source link

Forgot password link/screen #44

Open kft-a opened 3 years ago

kft-a commented 3 years ago

Changes for client

On LoginScreen Add button "Reset password" or similar which shows RequestPasswordReset component

New component RequestPasswordReset

  1. Text box requesting email address/user id
  2. Cancel button which jumps to LoginScreen
  3. Submit button which sends an axios post request to server "/requestpasswordreset"
  4. Shows message from response of requestpasswordreset.

New component ResetPassword

  1. Text box requesting new password
  2. Cancel button which jumps to LoginScreen
  3. Submit button which sends an axios post request to server "/resetpassword"
  4. Shows message from response of resetpassword.
kft-a commented 3 years ago

Changes for server

New post api /requestpasswordreset

  1. Takes an email address/userid as argument
  2. Checks that the email address/userid belongs to a user
  3. Generates a password reset token, and saves reset token and UserPassword in a in-memory map
  4. Sends email with link including the reset token to the user
  5. Sends a response to the react client with message: either succeeded or failed.

New post api /resetpassword

  1. Takes a password reset token and a password as arguments
  2. Looks up password token to find UserPassword object
  3. Checks expiry time on password token
  4. Updates the UserPassword object and commits
  5. Sends a response to the react client with message: either succeeded or failed.
zznicole commented 3 years ago

Thanks. Client-side the forget password link and components are created.