Add email required validation and email verification flow#56
Merged
Conversation
Copilot
AI
changed the title
[WIP] Make email address a required field
Add email required validation and email verification flow
Feb 19, 2026
v0l
requested changes
Feb 19, 2026
v0l
requested changes
Feb 19, 2026
v0l
approved these changes
Feb 19, 2026
v0l
marked this pull request as ready for review
February 19, 2026 15:15
…ations Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
…d_email, BIT(1) migration Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
…il required in User model Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
…ror handling - Rename migration to unique timestamp (20260220165223) - Fix migration to handle NULL emails and drop unique index - Use triple braces in mustache for unescaped HTML links - Add link styling for dark background (#3498db) - Use OpError for SMTP errors: Fatal (5xx) skipped, Transient retried - Add docs/agents/migrations.md with timestamp rules
v0l
force-pushed
the
copilot/make-email-required-field
branch
from
February 20, 2026 17:15
3def3a1 to
2505af8
Compare
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.
Email addresses were stored without format validation or ownership verification. This adds format enforcement, required-email gating for email notifications, and a full verification flow.
DB
email_verified BIT(1) NOT NULL DEFAULT 0,email_verify_token VARCHAR(64) NOT NULL DEFAULT '', and modifiesemailtoVARCHAR(255) NOT NULL DEFAULT ''onusersUser.emailchanged fromOption<EncryptedString>toEncryptedString(empty string = not set);email_verified: boolandemail_verify_token: Stringaddedget_user_by_email_verify_token(token)DB method + trait entryAPI
PATCH /api/v1/account:@+.check)contact_email: truewith no email setemail_verified = false, generates 32-byte hex token, persists it, queuesSendEmailVerificationjobGET /api/v1/account/verify-email?token=<token>: setsemail_verified = trueand clears the token; returns a styled HTML page (viaverify-email.htmlmustache template) confirming success or showing an error message (no auth required — link is the credential)GET /api/v1/accountresponse now includesemail_verified: bool(read-only; ignored on PATCH)Worker
WorkJob::SendEmailVerification { user_id, verify_url }handled bysend_email_verification()send_email(smtp, to, subject, message)static helper used by bothsend_notificationandsend_email_verification, eliminating duplicated SMTP/template logicemail.htmlconverted to mustache template ({{message}},{{year}})verify-email.htmlmustache template ({{title}},{{message}},{{color}}) included viainclude_str!Admin
AdminUserInfonow exposesemail_verifiedfor visibility in the admin panelOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.