Skip to content

feat(console): add self-service account email change flow#26367

Open
PanAchy wants to merge 4 commits intoanomalyco:devfrom
PanAchy:console-email-change-self-service
Open

feat(console): add self-service account email change flow#26367
PanAchy wants to merge 4 commits intoanomalyco:devfrom
PanAchy:console-email-change-self-service

Conversation

@PanAchy
Copy link
Copy Markdown
Contributor

@PanAchy PanAchy commented May 8, 2026

Issue for this PR

Closes #26363

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a self-service email change flow for OpenCode Console / Go / Zen accounts.

The flow requires two confirmations:

  • the current email confirms the account owner authorized the change
  • the new email verifies the destination address

Once both links are confirmed, the canonical auth.email row is updated to the new email. Existing Google/GitHub login identities remain linked to the same account, so the user keeps the same account, workspaces, billing, keys, and usage history.

Changes included:

  • adds an email_change Drizzle schema for pending email changes
  • adds core email-change request/confirm logic
  • adds pure confirmation state tests
  • adds an email confirmation template
  • adds a confirmation route
  • adds an account email change form in workspace settings

A maintainer will need to generate the Drizzle migration because bun run db-dev generate requires SST/Cloudflare credentials.

How did you verify your code works?

Ran:

cd packages/console/core && bun typecheck
cd packages/console/core && bun test test/email-change.test.ts test/date.test.ts test/subscription.test.ts
cd packages/console/app && bun typecheck
cd packages/console/app && bun test test/rateLimiter.test.ts
git diff --check dev...HEAD

The pre-push hook also ran the root typecheck successfully:

bun turbo typecheck

I could not run the full Console auth/DB/mail flow locally because sst shell --stage dev requires maintainer Cloudflare/SST credentials.

I also could not generate the Drizzle migration for the same reason.

Screenshots / recordings

N/A — I could not run the authenticated Console UI locally without maintainer environment credentials.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add self-service Console email change flow

1 participant