Repository navigation
Conversation
Member
|
Hey @manduinca, Thanks for the pr, unfortunately we have chosen the other pull-request. Thanks for trying to contribute, have a nice day and happy coding! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Checklist:
mainbranch of freeCodeCamp.Closes #68738
The rate limit check on
/update-my-emailran after theuser.update, so a second request within the 5 minute window returned 429 but had already overwrittennewEmail. That left the confirmation link sent to the first address broken, since/confirm-emailchecks it against the storednewEmail.I moved the check before the update, next to the other early returns (own email, email already taken, etc.). Same message and status code as before, and it reuses the
userwe already loaded so there's no extra query.I also extended the existing "second request returns 429" test to assert that
newEmailstill holds the first email after the rejected request. Confirmed it fails onmainwithout the change and passes with it.Followed the approach @Sembauke suggested in the issue.