8000 Apply VERIFY_EMAIL resend cooldown on new authentication sessions by julioo19 · Pull Request #54947 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Apply VERIFY_EMAIL resend cooldown on new authentication sessions - #54947

Open
julioo19 wants to merge 1 commit into
keycloak:mainfrom
julioo19:fix-verify-email-cooldown-54821
Open

julioo19 wants to merge 1 commit into
keycloak:mainfrom
julioo19:fix-verify-email-cooldown-54821

Conversation

@julioo19
@julioo19 julioo19 commented Nov 9, 2026
Copy link
Copy Markdown

Closes #54821

VerifyEmail.process() sent the verification e-mail whenever the authentication session had no VERIFY_EMAIL_KEY note, which is the case for every new session. The resend cooldown is stored per user, but it was only checked in processAction() (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 verifyEmailNewSessionRespectsResendCooldown to RequiredActionEmailVerificationTest. It fails without the fix (two e-mails instead of one) and passes with it. The rest of that class and AppInitiatedActionVerifyEmailTest also 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.

Closes keycloak#54821

Signed-off-by: Julio Cesar Montalvan <110637361+julioo19@users.noreply.github.com>
@julioo19
julioo19 requested review from a team as code owners November 9, 2026 20:58
Copilot AI balanced review requested due to automatic review settings November 9, 2026 20:58
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VERIFY_EMAIL resend cooldown is not applied on the challenge path: every new authentication session sends a verification e-mail

2 participants

0