Skip to content

Block unconfirmed users from API endpoints server-side#2916

Merged
jelveh merged 1 commit intomainfrom
fix-required-email-confirmation
May 5, 2026
Merged

Block unconfirmed users from API endpoints server-side#2916
jelveh merged 1 commit intomainfrom
fix-required-email-confirmation

Conversation

@jelveh
Copy link
Copy Markdown
Contributor

@jelveh jelveh commented May 5, 2026

Add a default-on email confirmation gate that rejects users with requires_email_confirmation && !email_confirmed on all authenticated routes, returning 403 with email_confirmation_required.

Previously this was only enforced client-side via a GUI modal, meaning direct API calls could bypass the check entirely.

Essential routes are exempted via allowUnconfirmed: true:
/whoami, /logout, /send-confirm-email, /confirm-email,
/save_account, /get-anticsrf-token, /get-gui-token,
/session/sync-cookie, /auth/revoke-session,
/user-protected/delete-own-user

No impact on temp users (requires_email_confirmation is false), self-hosted deployments without email (flag is never set), or unauthenticated routes (login, signup, password recovery, OIDC).

Add a default-on email confirmation gate that rejects users with
`requires_email_confirmation && !email_confirmed` on all authenticated
routes, returning 403 with `email_confirmation_required`.

Previously this was only enforced client-side via a GUI modal, meaning
direct API calls could bypass the check entirely.

Essential routes are exempted via `allowUnconfirmed: true`:
  `/whoami`, `/logout`, `/send-confirm-email`, `/confirm-email`,
  `/save_account`, `/get-anticsrf-token`, `/get-gui-token`,
  `/session/sync-cookie`, `/auth/revoke-session`,
  `/user-protected/delete-own-user`

No impact on temp users (`requires_email_confirmation` is false),
self-hosted deployments without email (flag is never set), or
unauthenticated routes (login, signup, password recovery, OIDC).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jelveh jelveh requested a review from Salazareo May 5, 2026 17:03
Copy link
Copy Markdown
Member

@Salazareo Salazareo left a comment

Choose a reason for hiding this comment

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

LGTM

@jelveh jelveh merged commit 1f1149e into main May 5, 2026
1 check passed
@jelveh jelveh deleted the fix-required-email-confirmation branch May 6, 2026 00:35
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.

2 participants