hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
181 stars 105 forks source link

[FEAT]: Password Reset Email Link - Backend #50

Closed Waptech07 closed 1 week ago

Waptech07 commented 1 month ago

Description

Implementing a feature that enables users to request a password reset link sent to their email.

Acceptance Criteria

Purpose

To ensure that users can initiate a password reset request and promptly receive a reset link via email, allowing them to regain access to their accounts in case they forget their password.

Requirements

Expected Outcome

Endpoints

Reset Password Email [POST] /api/v1/auth/password-reset-email

Description

Given a request with a valid email, when the user clicks on 'Forgot Password', the system should send a password reset link to the email provided with a 200 status code.

Request

POST /api/v1/auth/password-reset-email
{
  "email": "String"
}

Successful Response

{
  "message": "Password reset email sent successfully.",
  "reset_link": "https://endpoint.api/reset-password?token=unique_token"
}

Error Response

For an Invalid Email:

{
  "message": "String",
  "error": "String",
  "status_code": "Int"
}

Testing

Unit Tests:

Integration Tests:

Database Design

Untitled (4)

Implementation Details

Request Password Reset:

markessien commented 1 month ago

this is not an "email"

NdubuisiJr commented 1 month ago

@Waptech07 Please follow the endpoint versioning rule.

Waptech07 commented 1 month ago

@NdubuisiJr done