Repository navigation
Conversation
Closes keycloak#54821 Signed-off-by: Julio Cesar Montalvan <110637361+julioo19@users.noreply.github.com>
1 of 2 tasks
1 of 2 tasks
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 #54821
VerifyEmail.process()sent the verification e-mail whenever the authentication session had noVERIFY_EMAIL_KEYnote, which is the case for every new session. The resend cooldown is stored per user, but it was only checked inprocessAction()(the resend link).This change checks the cooldown in
process()before sending. While it is active, the page is rendered without sending an e-mail and without setting the note, so a refresh after the cooldown expires sends at most one e-mail (as discussed in the issue).Tests: added
verifyEmailNewSessionRespectsResendCooldowntoRequiredActionEmailVerificationTest. It fails without the fix (two e-mails instead of one) and passes with it. The rest of that class andAppInitiatedActionVerifyEmailTestalso pass locally.Since the old testsuite is deprecated, I followed
testsuite/DEPRECATED.md, which allows a limited number of changes to existing tests, mainly to add test cases when resolving bugs, and does not allow new files. This adds one test method and no new files. Happy to move it to the new Test Framework if you prefer though.Docs: no option was added or changed, and I found no hand-written docs describing this behavior.
AI usage: I used Claude to help me understand the code and the project workflow, to review my changes, and for suggestions on the test outline, some code comments, and the wording of this PR. I wrote the fix and the test logic myself and ran the tests locally.