2411: add resend login confirmation token functionality#622
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the 2FA login confirmation flow to use dedicated “verify” endpoints and adds the ability to resend the login verification token with a server-side cooldown. It also introduces authentication usage counting and queue-history linkage so resend attempts and failed verifications can be tracked and rate-limited.
Changes:
- Replace
/login-confirmationand/root/login-confirmationwith/login/verifyand/root/login/verify, storingauth_idin session and rendering the verify page via GET. - Add “resend verification token” UI + handler, backed by a cooldown derived from queue job history.
- Add
usage_counttopool_authenticationplus anIncreaseUsageCountevent and related persistence.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pool/web/view/page/page_root_login.ml | Updates root token confirmation URL to /root/login/verify. |
| pool/web/view/page/page_public.ml | Updates public token confirmation URL to /login/verify. |
| pool/web/view/page/page_login.ml | Adds resend-token UI and cooldown countdown script to the verify form. |
| pool/web/handler/root_login.ml | Switches root login 2FA flow to session-backed /root/login/verify GET/POST. |
| pool/web/handler/public_login.ml | Switches public login 2FA flow to session-backed /login/verify GET/POST and adds resend handler. |
| pool/web/handler/helpers_login.ml | Adds verify_2fa_login helper and failed-attempt increment helper. |
| pool/routes/routes.ml | Adds new public/root /login/verify routes and public resend route. |
| pool/pool_queue/repo.ml | Adds query to fetch last login-token send time from queue history. |
| pool/pool_queue/pool_queue.mli | Exposes find_last_login_token_sent_at. |
| pool/pool_queue/pool_queue.ml | Wires find_last_login_token_sent_at to the repo. |
| pool/pool_queue/entity.ml | Adds History.Authentication model mapping for queue history. |
| pool/app/pool_database/root.ml | Registers new migrations for root DB. |
| pool/app/pool_database/tenant.ml | Registers new migrations for tenant DB. |
| pool/app/pool_database/migrations/migration_202606170000.ml | Adds pool_queue_job_authentication mapping table. |
| pool/app/pool_database/migrations/migration_202607031200.ml | Adds usage_count to pool_authentication. |
| pool/app/message_template/message_template.ml | Associates 2FA token emails with authentication history items. |
| pool/app/authentication/repo.ml | Persists usage_count, caps validity by usage, adds usage-count increment query. |
| pool/app/authentication/event.ml | Adds IncreaseUsageCount event handler. |
| pool/app/authentication/entity.ml | Adds UsageCount type and limit. |
| pool/app/authentication/authentication.mli | Exposes UsageCount and event type update. |
| pool/app/authentication/authentication.ml | Initializes usage_count on creation. |
PossessedC0bra
marked this pull request as ready for review
July 14, 2026 08:51
- implement auth token job log
- split login and 2FA verification over 2 pages - track 2FA token usage and fail login if limit is reached
… last sent auth token
- extract common login flow into helpers_login.ml
PossessedC0bra
force-pushed
the
feature/ykl/2411-mfa-token-resend
branch
from
July 14, 2026 10:18
8dcb9fe to
5194a52
Compare
mabiede
requested changes
Jul 14, 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.
No description provided.