Users change their own e-mail address on the profile page, confirmed by a link unless the administrator turns that off #286

Merged
claude merged 8 commits from feature/66-self-service-email into develop 2026-11-05 05:11:24 -05:00
Owner

A signed-in user can now change their own e-mail address (epic #63). The change needs their current password. By default it needs confirmation by a link sent to the new address.

API (#66)

  • POST /api/users/me/email {newEmail, currentPassword}:
    • 202 {confirmationSent:true} when confirmation is required (the default). Nothing changes until the link is opened.
    • 200 with the profile when confirmation is off. The address changes at once and EmailConfirmed is kept, as the administrator's change keeps it.
    • 400 for a wrong password, an invalid or taken address, or missing SMTP or base URL.
  • POST /api/auth/confirm-email-change {userId, email, token} (anonymous): 204 on success. Any bad, expired or reused token, and any unknown or disabled user, gets the same 400.
  • On every change the security stamp is updated and refresh tokens are revoked, so every session ends, the current one included. UserAccountChangedEvent replicates the change, and the old address gets a notice when SMTP is configured.
  • GET /api/users/me gains emailChangeRequiresConfirmation. /api/identity-settings gains requireEmailChangeConfirmation.
  • Action and model docs no longer leak raw framework crefs into the OpenAPI document (four places, two of them already on develop).

Snapshot and client (#67) are in separate commits.

Console (#68)

  • A "Change e-mail" card on the Profile page says beforehand which path applies and that every session ends.
  • The anonymous /confirm-email-change page posts the link's values once.
  • A "Require e-mail confirmation" switch is under Settings, Identity.
  • README Security section updated.

Tests:

  • EmailChangeSelfServiceTests and EmailChangeSettingTests. They run on a second host, so the shared host's settings stay untouched.
  • New console specs. A smoke-harness page covers an invalid token.
  • Web.Tests 2063, ClusterSync 47, Identity 77, console 1648. Lint, format and build are clean.
  • The verifier passed the branch on the second round. The first round found the undeclared 204, the cref leak, and docs that named a console page before it existed. All three are fixed here.

Follow-ups filed: #284 (wrong current passwords count toward lockout) and #285 (rate limit the anonymous token endpoints).

Closes #66
Closes #67
Closes #68

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

A signed-in user can now change their own e-mail address (epic #63). The change needs their current password. By default it needs confirmation by a link sent to the new address. **API (#66)** - `POST /api/users/me/email` `{newEmail, currentPassword}`: - 202 `{confirmationSent:true}` when confirmation is required (the default). Nothing changes until the link is opened. - 200 with the profile when confirmation is off. The address changes at once and `EmailConfirmed` is kept, as the administrator's change keeps it. - 400 for a wrong password, an invalid or taken address, or missing SMTP or base URL. - `POST /api/auth/confirm-email-change` `{userId, email, token}` (anonymous): 204 on success. Any bad, expired or reused token, and any unknown or disabled user, gets the same 400. - On every change the security stamp is updated and refresh tokens are revoked, so every session ends, the current one included. `UserAccountChangedEvent` replicates the change, and the old address gets a notice when SMTP is configured. - `GET /api/users/me` gains `emailChangeRequiresConfirmation`. `/api/identity-settings` gains `requireEmailChangeConfirmation`. - Action and model docs no longer leak raw framework crefs into the OpenAPI document (four places, two of them already on develop). **Snapshot and client (#67)** are in separate commits. **Console (#68)** - A "Change e-mail" card on the Profile page says beforehand which path applies and that every session ends. - The anonymous `/confirm-email-change` page posts the link's values once. - A "Require e-mail confirmation" switch is under Settings, Identity. - README Security section updated. **Tests:** - `EmailChangeSelfServiceTests` and `EmailChangeSettingTests`. They run on a second host, so the shared host's settings stay untouched. - New console specs. A smoke-harness page covers an invalid token. - Web.Tests 2063, ClusterSync 47, Identity 77, console 1648. Lint, format and build are clean. - The verifier passed the branch on the second round. The first round found the undeclared 204, the cref leak, and docs that named a console page before it existed. All three are fixed here. Follow-ups filed: #284 (wrong current passwords count toward lockout) and #285 (rate limit the anonymous token endpoints). Closes #66 Closes #67 Closes #68 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #66
Closes #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #68

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #68

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The README's e-mail change bullet and the route table comment are wrapped like their neighbours
Some checks failed
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -1m39s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -1m24s
Build / Build Binary (linux-amd64) (pull_request) Successful in -16s
Build / Build Binary (macos-amd64) (pull_request) Successful in -34s
Build / Build Binary (windows-amd64) (pull_request) Successful in -29s
Build / Build Binary (linux-arm64) (pull_request) Successful in 7m51s
Build / Build Binary (macos-arm64) (pull_request) Successful in 7m31s
Build / Build and Push Image (pull_request) Successful in -2m29s
Build / Smoke Test the Windows Binary (pull_request) Successful in 17s
Build / Build Arch Linux Packages (pull_request) Successful in 28s
Build / Test .NET (push) Failing after 15m22s
Build / Stage Draft Release (push) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (push) Has been skipped
Build / Pack and Push NuGet Packages (common) (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Publish Release (push) Has been skipped
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -42s
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Publish Release (pull_request) Successful in -1s
Build / Pipeline (pull_request) Successful in 0s
97fc81cb9c
Refs #68

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 706f73e613 into develop 2026-11-05 05:11:24 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!286
No description provided.