Feat forgot password endpoint#721
Merged
yusuftomilola merged 3 commits intoApr 26, 2026
Merged
Conversation
|
Someone is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@RUKAYAT-CODER Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
yusuftomilola
approved these changes
Apr 26, 2026
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.
close #598
close #601
Task 1: Excel and PDF Export Endpoints
Reports Module Created:
backend/contrib/src/reports/reports.module.ts - Module definition with Asset entity
backend/contrib/src/reports/reports.service.ts - Service with Excel and PDF generation
backend/contrib/src/reports/reports.controller.ts - Controller with protected endpoints
Endpoints Implemented:
GET /reports/export/excel - Generates .xlsx using exceljs with formatted table
GET /reports/export/pdf - Generates PDF using pdfkit with title, date, and asset table
Features:
Both endpoints protected by JwtAuthGuard
Excel columns: Asset ID, Name, Category, Department, Status, Condition, Purchase Price, Location, Created Date
PDF mirrors same columns in readable layout
Proper Content-Type and Content-Disposition headers
Task 2: Forgot Password and Reset Password Endpoints
Password Reset Token Entity:
backend/contrib/src/auth/password-reset-token.entity.ts - Entity with id, userId, tokenHash, expiresAt, usedAt
Mail Module:
backend/contrib/src/mail/mail.module.ts - Mail module configuration
backend/contrib/src/mail/mail.service.ts - Nodemailer service for email sending
Auth Endpoints:
POST /auth/forgot-password - Accepts { email }, generates 15-minute token, stores hashed token, sends email
POST /auth/reset-password - Accepts { token, newPassword }, validates token, updates password, invalidates token
DTOs Created:
backend/contrib/src/auth/dto/forgot-password.dto.ts - Email validation
backend/contrib/src/auth/dto/reset-password.dto.ts - Token and new password validation
Environment Variables Required:
MAIL_HOST, MAIL_PORT, MAIL_USER, MAIL_PASS, MAIL_FROM
FRONTEND_URL (optional, defaults to http://localhost:3000/)
All dependencies have been installed, modules properly configured, and the ReportsModule has been added to the main AppModule. The implementation follows NestJS best practices with proper error handling, validation, and security measures.