- SUMMARY.md with OIDC login redirect, auth hook cleanup, E2E seed, test updates - STATE.md updated with decisions and session info - ROADMAP.md updated with phase 15 progress - Requirements AUTH-01, AUTH-02, AUTH-05 marked complete
6.1 KiB
6.1 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15-external-authentication | 03 | auth |
|
|
|
|
|
|
|
|
|
4min | 2026-04-04 |
Phase 15 Plan 03: Client Auth UI, E2E Seed, and Test Updates Summary
OIDC login redirect page, cleaned auth hooks (string user id, no credential forms), API-key E2E seed, and three-way auth test coverage
Performance
- Duration: 4 min
- Started: 2026-04-04T18:50:52Z
- Completed: 2026-04-04T18:54:28Z
- Tasks: 3 (2 auto + 1 checkpoint auto-approved)
- Files modified: 8
Accomplishments
- Login page redirects to Logto via server-side OIDC instead of showing username/password form
- Auth hooks match new OIDC API response shape (user.id is string, no setupRequired)
- E2E seed creates API key for test authentication instead of inserting into removed users table
- Auth middleware and route tests validate all three auth paths with proper mocking
Task Commits
Each task was committed atomically:
- Task 1: Rewrite login page and auth hooks for OIDC -
79b27b6(feat) - Task 2: Update E2E seed script and auth-related tests -
689a56b(feat) - Task 3: Verify OIDC login flow - auto-approved checkpoint (no commit)
Files Created/Modified
src/client/hooks/useAuth.ts- Removed useLogin/useSetup/useChangePassword, updated AuthState to string idsrc/client/routes/login.tsx- Replaced credential form with OIDC redirect buttonsrc/client/routes/settings.tsx- Removed ChangePasswordSection, use authenticated flagsrc/client/components/UserMenu.tsx- Updated logout call from mutation to direct functione2e/seed.ts- API key creation instead of user insertiontests/middleware/auth.test.ts- Three-way auth tests with mocked getAuth and verifyAccessTokentests/services/auth.service.test.ts- API key CRUD tests only (removed user/session tests)tests/routes/auth.test.ts- GET /me with mocked OIDC, API key CRUD routes
Decisions Made
- Login page renders a "Sign In" button that triggers
window.location.href = "/login"for full-page navigation to server OIDC redirect - useLogout returns a plain
{ logout }object instead of useMutation since it performs a redirect, not an API call - Removed ChangePasswordSection from settings entirely since passwords are managed in Logto
- Settings page API keys section gated on
auth?.authenticatedinstead ofauth?.user - E2E seed uses a static deterministic API key string for reproducible test runs
Deviations from Plan
Auto-fixed Issues
1. [Rule 3 - Blocking] Updated UserMenu.tsx for new useLogout API
- Found during: Task 1 (Rewrite auth hooks)
- Issue: UserMenu called
logout.mutate()but new useLogout returns{ logout }function, not a mutation - Fix: Changed
logout.mutate()tologout()in UserMenu onClick handler - Files modified: src/client/components/UserMenu.tsx
- Verification: No remaining
logout.mutatereferences in codebase - Committed in:
79b27b6(Task 1 commit)
2. [Rule 3 - Blocking] Removed ChangePasswordSection from settings page
- Found during: Task 1 (Rewrite auth hooks)
- Issue: Settings page imported and used
useChangePasswordwhich was removed from hooks; page would not compile - Fix: Removed entire ChangePasswordSection component and its import from settings.tsx
- Files modified: src/client/routes/settings.tsx
- Verification: No references to useChangePassword remain in client code
- Committed in:
79b27b6(Task 1 commit)
Total deviations: 2 auto-fixed (2 blocking issues) Impact on plan: Both fixes were necessary to keep the client compiling after hook removals. No scope creep.
Deferred Items
tests/routes/oauth.test.tsstill referencescreateUserfrom old auth service (pre-existing, not caused by this plan)
Issues Encountered
None
User Setup Required
None - no external service configuration required for this plan (infrastructure was set up in Plan 01).
Next Phase Readiness
- Client auth UI complete and aligned with OIDC backend from Plan 02
- E2E seed ready for API-key-based test authentication
- All auth-related unit/integration tests updated for new architecture
- Phase 15 external authentication integration is complete across all three plans
Phase: 15-external-authentication Completed: 2026-04-04