added rate limiter | cannot submit current password | throws specific… #220
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 24-hour rate limiting mechanism for password resets, improves backend and frontend handling of password reset and authentication errors, and enhances user experience by providing clearer error messages and preventing password reuse. The backend now tracks the last password reset time for each user and enforces the rate limit, while the frontend consistently displays server-provided error messages. Several API error response types have also been standardized.
Backend: Password Reset Rate Limiting and Security Enhancements
passwordResetRateLimiterthat enforces a 24-hour rate limit on password reset requests per user, using a newlastPasswordResetAtfield on theUsermodel. This middleware is now applied to the/forgot-passwordroute. [1] [2] [3] [4] [5] [6]lastPasswordResetAttimestamp upon a successful password reset.Frontend: Error Handling and User Feedback Improvements
API Types and Documentation
ErrorResponsetype to include a structurederrorobject withcode,message, and optionaldetails, standardizing error payloads across the frontend and backend.These changes collectively improve security, user experience, and maintainability of the password reset and authentication flows.… errors | flow: -> new-password -> new-password-made -> login
Final PR request!