Skip to content

feat(backend): Implement rate-limited password reset and account reco… - #1065

Open
sarah-obasi-analytics wants to merge 1 commit into
ceejaylaboratory:mainfrom
sarah-obasi-analytics:feat/issue-35-backend-implement-rate-limited
Open

feat(backend): Implement rate-limited password reset and account reco…#1065
sarah-obasi-analytics wants to merge 1 commit into
ceejaylaboratory:mainfrom
sarah-obasi-analytics:feat/issue-35-backend-implement-rate-limited

Conversation

@sarah-obasi-analytics

Copy link
Copy Markdown

…very endpoints

  • Add UserPasswordResetToken model to Prisma schema
  • Implement UserPasswordResetService with token hashing
  • Add POST /password-reset/request (rate-limited) and POST /password-reset/confirm to users.route.ts
  • Add integration tests for password reset workflow

Closes #939

Task Completed:
I have completed the implementation and testing plan
I have completed the requested changes on the branch feat/issue-35-backend-implement-rate-limited.

Summary of Changes:

  1. Database: Updated backend/prisma/schema.prisma to add the UserPasswordResetToken model to support hashing and expiration of reset
    tokens.
  2. Service: Created backend/src/services/user-password-reset.service.ts to handle token generation, hashing (SHA-256), and confirmation
    logic.
  3. Routes: Updated backend/src/api/routes/users.route.ts to include:
    • POST /password-reset/request: Implemented with a rate limiter (max: 3, windowMs: 1 hour) using the rate-limit.middleware.
    • POST /password-reset/confirm: Implemented for validating tokens and resetting passwords.
  4. Testing: Added backend/src/api/routes/users.route.test.ts with integration tests covering the password reset request rate limiting.

…very endpoints

- Add UserPasswordResetToken model to Prisma schema
- Implement UserPasswordResetService with token hashing
- Add POST /password-reset/request (rate-limited) and POST /password-reset/confirm to users.route.ts
- Add integration tests for password reset workflow

Closes ceejaylaboratory#35
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@sarah-obasi-analytics 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Implement rate-limited password reset and account recovery endpoints

1 participant