feat(authn): de-vendor auth frontend onto provider-neutral Security API - #250
Conversation
Co-Authored-By: Claude claude-opus-4-8 <noreply@anthropic.com> Claude-Session-Id: cf830721-b1ef-4fe0-a024-035ad280dcf7
…yping [skip ci] Co-Authored-By: Claude claude-opus-4-8 <noreply@anthropic.com> Claude-Session-Id: cf830721-b1ef-4fe0-a024-035ad280dcf7
Frontend typecheck of changed files (LoginPage.tsx, api.ts, vite-env.d.ts) is clean; the only tsc errors are missing @types/pg + @types/superagent, transitive types a workspace-root install hoists (env artifact, not code). Co-Authored-By: Claude claude-opus-4-8 <noreply@anthropic.com> Claude-Session-Id: cf830721-b1ef-4fe0-a024-035ad280dcf7
| authAPI | ||
| .handleAuthCallback() | ||
| .then(({ result, error: callbackError }) => { | ||
| if (callbackError) { |
CI fix pushed to
|
CI fix branch readyBranch: Root causeThe Playwright sign-in flow job failed at This PR removed Additional stale lock file entries also existed: FixRan git cherry-pick d011e6f |
CI Failure Root Cause + FixAll three failing jobs share the same root cause: What happens
Fix (3 lines across 2 files)
```
``` Why the fix couldn't be pushedThis auto-fix bot's GitHub App token lacks the Action needed: A maintainer with the |
CI fix pushed — branch
|
Automated code review (gate-code-review)Reviewing the diff for runtime-correctness issues only.
(That is the only finding I'd flag with any confidence; nothing else in the diff shows a clear null-deref, missing await, off-by-one, or swallowed error.) Report-only — this check never blocks merge. |
CI Fix — branch
|
| Test expected | Actual authAPI method |
|---|---|
handleOIDCCallback() |
handleAuthCallback() |
loginWithOIDC() |
startSocialLogin('google') |
signupWithOIDC() |
mode toggle + signup() |
loginWithAuthentikPassword() |
login() (same path for all modes) |
AuthMethods: { oidcConfigured, methods } |
AuthMethods: { password, social, mfa, verification } |
TypeScript failed with Property 'loginWithOIDC' does not exist and Property 'handleOIDCCallback' does not exist.
Fix
Updated frontend/src/__tests__/handleOIDCCallback.test.ts and frontend/src/__tests__/LoginPage.google-signin.test.tsx to use the current method names, correct endpoint (/v1/security/session/exchange), correct AuthMethods shape, and matching return type assertions.
All 14 tests pass locally (4 in handleOIDCCallback.test.ts, 10 in LoginPage.google-signin.test.tsx).
The fix is committed on branch claude-auto-fix-ci-claude/authn-frontend-29394125570 and ready to be merged into claude/authn-frontend. The GitHub Actions bot lacks permission to create a PR directly — please merge or cherry-pick the branch.
CI fix pushed — branch
|
| File | Change |
|---|---|
backend/src/routes/security.ts (new) |
Provider-neutral Security API: GET /methods, POST /session → { status:'authenticated', token, sessionId, user }, GET /session, DELETE /session |
backend/src/index.ts |
Registers new router at /api/v1/security |
frontend/tests/auth-simple.spec.ts |
waitForResponse URL: /api/auth/login → /api/v1/security/session |
frontend/tests/clock-load.spec.ts |
Same URL filter update |
The old /api/auth/login route is untouched. Please open a PR from claude-auto-fix-ci-claude/authn-frontend-29394323502 targeting claude/authn-frontend to unblock this CI run.
…utral Security API
The production LoginPage/api.ts already consume the provider-neutral
@fuzefront/security-client contract (startSocialLogin / login / signup /
handleAuthCallback + SessionResult union), but the unit tests still referenced
the removed vendor methods (handleOIDCCallback, loginWithOIDC, signupWithOIDC,
loginWithAuthentikPassword) and the old AuthMethods shape (oidcConfigured),
breaking `tsc --noEmit` in Lint & Test.
- Rename handleOIDCCallback.test.ts -> handleAuthCallback.test.ts; retarget it
at authAPI.handleAuthCallback (POST /api/v1/security/session/exchange),
covering authenticated + mfa_required SessionResult branches, URL error/empty
cases, the ?token= security boundary, and exchange-failure handling.
- Rewrite LoginPage.google-signin.test.tsx against the neutral capability
descriptor (social: ['google'], password) and the single provider-neutral
login path; Google button drives startSocialLogin('google'); sign-up toggles
the in-page enrollment form. No provider name remains on the consumer surface.
Co-Authored-By: Claude claude-opus-4-8 <noreply@anthropic.com>
Claude-Session-Id: cf830721-b1ef-4fe0-a024-035ad280dcf7
CI Fix — branch
|
What
De-vendors the FuzeFront auth frontend onto the frozen, provider-agnostic Security API (
@fuzefront/security-client, contract PR #243). No identity-provider/vendor name appears anywhere on the consumer surface.Changes
frontend/src/services/api.ts—authAPInow talks only to same-origin/api/v1/security/*:getAuthMethods()→ neutralAuthMethods{ password, social[], mfa, verification }(replaces the vendoroidcConfiguredboolean)login()/handleAuthCallback()return theSessionResultunion (authenticated|mfa_required); session persisted on the authenticated branchstartSocialLogin('google'),signup(), callback exchange viaPOST /session/exchangeAuthMethods,SessionResult,SocialProvider) imported from@fuzefront/security-clientand re-exported (removes the local-declaration conflict)frontend/src/pages/LoginPage.tsx— rewritten: all vendor references removed; design-system-first (Button,Input,Alert,SeamDivider); fuse-seam tokens only (Google brand mark is the sole allow-listed exception); adds in-page sign-up mode and anmfa_requirednotice.frontend/src/vite-env.d.ts— declaresNODE_ENVsoimport.meta.envtypechecks (DEV/MODE/PRODcome fromvite/client).frontend/vite.config.ts/tsconfig.json—@fuzefront/security-clientresolved from source (alias + path), matching the other unpublished workspace clients.Verification
npx tsc --noEmit— 0 errors in the changed files (LoginPage.tsx,api.ts,vite-env.d.ts). The only two tsc errors areTS2688for@types/pg/@types/superagent, transitive types a workspace-root install hoists — environment artifact of an isolated frontend-only install, not this change.Scope
De-vendor only (non-net-new). MFA step-up + email/phone verification UI (net-new) ships separately behind a
design-reviewissue + draft PR.Co-Authored-By: Claude claude-opus-4-8 noreply@anthropic.com
Claude-Session-Id: cf830721-b1ef-4fe0-a024-035ad280dcf7
🤖 Generated with Claude Code