feat(auth): require email verification for new signups#191
Draft
jerryzhou196 wants to merge 1 commit into
Draft
Conversation
New email/password accounts now receive a 6-character code and must verify before they can log in. Mirrors the existing password-reset machinery: - migration: queue.email_verify table + notify trigger, and a verified column on secret.user_email (existing accounts default to verified) - register withholds the JWT and queues a code; login rejects unverified accounts; add /auth/email/verify and /auth/email/verify/send - mail worker renders and sends the verification email Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jerryzhou196
commented
Jun 22, 2026
| "/auth/email/register", | ||
| serde.WithDbResponse(conn, auth.RegisterEmail, "email register"), | ||
| ) | ||
| router.Post( |
Member
Author
There was a problem hiding this comment.
are these endpoints protected. if so where?
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.
What
Adds email verification to the email/password signup flow, mirroring the existing password-reset machinery. New accounts are created unverified and cannot log in until they enter a 6-character code emailed to them.
Changes
1782094648000_email_verification): addsqueue.email_verify(one pending code per user) with asendmail_notify('email_verify')trigger, plus averifiedcolumn onsecret.user_email. Existing accounts default toverified = TRUEso nobody is locked out.flow/api/auth):registernow insertsverified = FALSE, queues a code, and withholds the JWT. NewPOST /auth/email/verify(consumes code → marks verified → returns JWT) andPOST /auth/email/verify/send(resend).loginrejects unverified accounts withemail_not_verified.flow/email): newemail_verifyqueue case, scan, item type, and template.email_not_verified,invalid_verify_key.Notes
secret.user_email.flow/api/parse/pdfbuild needs thepopplersystem lib locally; unrelated to this change. Touched packages build/vet clean andgo test ./email/format/passes.Pairs with the frontend PR (UWFlow/uwflow_frontend) that adds the code-entry step.
🤖 Generated with Claude Code