12419 fix rerequesting pwd reset after an approved request has expired#105
Merged
giregk merged 2 commits intoJun 18, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the password reset request flow to avoid reusing expired password reset authorizations by filtering out expired reset_token_expiration_date records at query time, and removes the previous “expired token” handling branches in the route handler.
Changes:
- Filters the
password_reset_requestlookup to only return requests with a non-expiredreset_token_expiration_date(orNULL). - Removes the server-side logic that regenerated tokens / restarted requests when an existing request was expired.
Comments suppressed due to low confidence (1)
src/api2/routes/passwordReset/requestPasswordReset.ts:133
- When manual validation is disabled,
resetRequestcan still be aPENDING_ADMIN_CHECKrow (or any non-COMPLETEDrow) because the earlier SELECT does not filter bystatus/reset_tokenand explicitly allowsreset_token_expiration_date IS NULL. In that caseresetRequest.reset_token/resetRequest.reset_token_expiration_datemay be null, butsendPasswordResetRequestEmail()requires a non-null token and aDateexpiration, so this path can throw (or send a malformed email) instead of generating a new token.
} else {
await sendPasswordResetRequestEmail(
safeBody.userEmail,
authDbRes.rows[0].device_name,
resetRequest.reset_token,
resetRequest.reset_token_expiration_date,
acceptLanguage,
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
123justin123
approved these changes
Jun 18, 2026
44d0804
into
rgsystemes:fix-12419-rerequesting-pwd-reset-after-approved-expired-request
1 check passed
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.
https://github.com/rgsystemes/kb/issues/12419