NoroffFEU / agency-api.noroff.dev

The Unlicense
2 stars 12 forks source link

User reset password #134

Open Jarle302 opened 10 months ago

Jarle302 commented 10 months ago

This PR introduces a new password reset flow changes include:

  1. Password Reset Initiation: Added a POST endpoint /users/resetPassword. This endpoint validates user emails and generates a time-limited hashed token for password resets.

  2. Email Integration: Incorporated dependency injection for the email service to send password reset links with the unhashed token.

  3. Password Reset Completion: Established a new POST endpoint /users/newPassword for finalizing the password reset. This endpoint validates the token, checks its expiration, and updates the password securely.

Any suggestions are more than welcome, thanks in advance!