Dis 187 reset password if forgotten back#164
Merged
Benbenzhouz merged 4 commits intomainfrom Dec 9, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements a complete password reset flow for the authentication system, including backend API endpoints, AWS SES email delivery, database schema changes, and an HTML email template.
Key Changes:
- Added password reset endpoints (
/forgot-passwordand/reset-password) with token-based validation and 15-minute expiration - Integrated AWS SES for transactional email delivery with a branded HTML email template
- Extended the User schema with
resetPasswordTokenandresetPasswordExpiresfields
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
templates/email.html |
New HTML email template for password reset notifications with company branding |
src/modules/user/schema/user.schema.ts |
Added optional fields for password reset tokens and expiration; updated default message text |
src/modules/ses/ses.service.ts |
New service for sending emails via AWS SES with error logging |
src/modules/ses/ses.module.ts |
New module exporting SES service for dependency injection |
src/modules/auth/dto/reset-password.dto.ts |
New DTO for validating password reset requests with token and password fields |
src/modules/auth/auth.service.ts |
Implemented forgotPassword and resetPassword methods with secure token generation and validation |
src/modules/auth/auth.module.ts |
Integrated SesModule into authentication module |
src/modules/auth/auth.controller.ts |
Added /forgot-password and /reset-password endpoints with CSRF exemption |
package.json |
Added @aws-sdk/client-ses and ses dependencies |
pnpm-lock.yaml |
Lockfile updates for new AWS SDK and related dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
|
ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a complete password reset flow to the authentication system, including backend endpoints, data model changes, and email delivery via AWS SES. It also adds a new SES module for sending emails, updates dependencies, and includes an HTML email template for password reset notifications.
Password Reset Feature:
AuthControllerfor requesting a password reset (POST /forgot-password) and for resetting the password (POST /reset-password), both with appropriate API documentation and response handling.forgotPasswordandresetPasswordmethods inAuthService, including secure token generation, token expiration, validation, and password update logic.ResetPasswordDtofor validating reset password requests.Userschema to includeresetPasswordTokenandresetPasswordExpiresfields for tracking password reset requests.Email Delivery via AWS SES:
SesModuleandSesServicefor sending emails using AWS SES, including configuration via environment variables and error logging.SesModuleinto the authentication module and injectedSesServiceintoAuthService.templates/email.html) for the password reset email, with dynamic placeholders for user name and reset link.Dependency Updates:
@aws-sdk/client-sesandsespackages topackage.jsonto support AWS SES email sending.Other Minor Changes: