Repository navigation
fix(api): validate the emailed approval token on the delayed-approval path - #589
Merged
Merged
Conversation
… path approveViaToken went straight to approveWithDelay when a purchase delay was configured, so only the immediate path (ApproveExecution) checked the token. Export purchase.ValidateApprovalToken, call it before scheduling and map errors through tokenActionError (403 invalid, 410 expired). Closes #586.
Contributor
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 38 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 64 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
Comment |
This was referenced Oct 6, 2026
This was referenced Oct 20, 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.
Closes #586
With a purchase delay configured,
approveViaTokencalledapproveWithDelaywithout checking the emailed token; only the immediate path (ApproveExecution) did. A contact-email session with tokenWRONGgot 200 "scheduled".purchase.ValidateApprovalTokenand call it beforeapproveWithDelay, mapped viatokenActionError(403 invalid, 410 expired).CancelExecution), revoke (validateRevokeToken) and SQS approve (ApproveExecution) already validate; session-mode approve is fix(purchase): approve and direct-execute map every failure to 409, partial runs mint no revocation token, and approved-row claim races #532.Tests through HandleRequest (delay 1h): wrong token 403, expired 410, no stored token 403, valid token schedules 200, scheduled replay 409. The three rejection cases returned 200 before the fix.
🤖 Generated with Claude Code