Skip to content

2411: add resend login confirmation token functionality#622

Merged
PossessedC0bra merged 25 commits into
mainfrom
feature/ykl/2411-mfa-token-resend
Jul 15, 2026
Merged

2411: add resend login confirmation token functionality#622
PossessedC0bra merged 25 commits into
mainfrom
feature/ykl/2411-mfa-token-resend

Conversation

@PossessedC0bra

Copy link
Copy Markdown
Member

No description provided.

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.

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-confirmation and /root/login-confirmation with /login/verify and /root/login/verify, storing auth_id in 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_count to pool_authentication plus an IncreaseUsageCount event 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.

Comment thread pool/web/view/page/page_login.ml
Comment thread pool/web/handler/public_login.ml Outdated
Comment thread pool/web/handler/public_login.ml Outdated
Comment thread pool/app/authentication/repo.ml
Comment thread pool/app/pool_database/migrations/migration_202607031200.ml Outdated
Comment thread pool/pool_queue/repo.ml
@PossessedC0bra
PossessedC0bra marked this pull request as ready for review July 14, 2026 08:51
@PossessedC0bra
PossessedC0bra force-pushed the feature/ykl/2411-mfa-token-resend branch from 8dcb9fe to 5194a52 Compare July 14, 2026 10:18

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.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Comment thread pool/web/view/page/page_login.ml
Comment thread pool/web/handler/helpers_login.ml
Comment thread pool/app/pool_database/migrations/migration_202607141227.ml
Comment thread pool/app/authentication/repo.ml
@PossessedC0bra
PossessedC0bra requested a review from mabiede July 14, 2026 12:34
Comment thread pool/pool_queue/repo.ml Outdated
Comment thread pool/web/handler/helpers_login.ml Outdated
Comment thread pool/web/handler/helpers_login.ml Outdated
Comment thread pool/web/handler/helpers_login.ml Outdated
Comment thread pool/app/authentication/authentication.ml Outdated
@PossessedC0bra
PossessedC0bra requested a review from mabiede July 14, 2026 14:14

@mabiede mabiede 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.

LGTM

@PossessedC0bra PossessedC0bra changed the title feat: add resend login confirmation token functionality 2411: add resend login confirmation token functionality Jul 15, 2026
@PossessedC0bra
PossessedC0bra merged commit 8f45a8b into main Jul 15, 2026
9 checks passed
@PossessedC0bra
PossessedC0bra deleted the feature/ykl/2411-mfa-token-resend branch July 15, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants