feat: account management — change email, password, and CLI reset (#10)

API:
- PATCH /auth/me — update email and display name
- PATCH /auth/me/password — change password (requires current)
- GET /auth/me now returns full profile (email, full_name, role)

CLI:
- python -m src.cli.reset_password --email <email> --password <pw>
  for recovery when locked out (run via docker exec)

Admin UI:
- User menu dropdown on the top nav (click username → Account /
  Sign out) replaces the inline sign-out link
- /account page with profile form (email + display name) and
  change password form (current + new + confirm)
This commit is contained in:
James Cottrill
2026-04-18 21:53:32 +01:00
committed by GitHub
parent 142e2373d3
commit d8e0a34e04
10 changed files with 484 additions and 21 deletions

View File

@@ -117,7 +117,8 @@ class TestMeEndpoint:
role="owner",
email="admin@test.com",
)
db = _mock_db()
mock_user = _make_user(id=user_id, org_id=org_id, email="admin@test.com", role="owner")
db = _mock_db(scalar_one_or_none=mock_user)
async with await _client(mock_app, db) as client:
resp = await client.get(
"/api/v1/auth/me",