Skip to content

auth: mandatory email verification in cloud mode#227

Merged
keysersoft merged 1 commit into
mainfrom
keysersoft/cloud-mandatory-email-verification
May 19, 2026
Merged

auth: mandatory email verification in cloud mode#227
keysersoft merged 1 commit into
mainfrom
keysersoft/cloud-mandatory-email-verification

Conversation

@keysersoft
Copy link
Copy Markdown
Contributor

Summary

  • Hide the Skip for now button on the email-verification step when DEPLOYMENT_MODE=cloud so cloud users cannot bypass verification post-registration.
  • New EmailVerifiedGuard registered as a global APP_GUARD. In cloud mode it rejects authenticated requests from users with emailVerified=false with 403 Forbidden, except on the auth-flow paths needed to actually verify (verify-email, resend-verification, login, register, forgot/reset-password, logout, health).
  • Self-hosted deployments are untouched.

Why

On cloud.anythingmcp.com users were able to register, click Skip for now, and use the service indefinitely without ever verifying their email. That broke abuse-prevention and trial-tracking. Behavior must remain unchanged for self-hosted operators who don't run SMTP.

Test plan

  • DEPLOYMENT_MODE=cloud — register, confirm Skip button is gone, confirm protected endpoints return 403 until verified, confirm /api/auth/verify-email works
  • DEPLOYMENT_MODE=cloud — after verification, all endpoints work as before
  • DEPLOYMENT_MODE=self-hosted (or unset) — Skip still appears, all endpoints work regardless of emailVerified

Cloud-hosted instances now require users to verify their email before they
can access any non-auth endpoint.

Frontend: hide the 'Skip for now' button on the email verification step
when DEPLOYMENT_MODE=cloud.

Backend: new EmailVerifiedGuard registered globally. When DEPLOYMENT_MODE=cloud,
authenticated users whose emailVerified=false are rejected with 403, except
on the auth-flow paths needed to complete verification (verify-email,
resend-verification, login, register, forgot/reset password, logout, health).

Self-hosted deployments are unaffected.
@keysersoft keysersoft requested a review from mirkopoloni as a code owner May 19, 2026 15:28
@keysersoft keysersoft merged commit fdbcafc into main May 19, 2026
11 checks passed
@keysersoft keysersoft deleted the keysersoft/cloud-mandatory-email-verification branch May 19, 2026 15:30
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.

1 participant