対象は frontend/ のみ。backend/expo-test と backend/dev-client は廃止済みであり、復活させない。
sequenceDiagram
participant UI as React画面
participant Hook as AuthProvider
participant Auth as services/auth.ts
participant SS as SecureStore
participant API as Go API
UI->>Hook: login / passkey / logout
Hook->>Auth: single-flight実行
Auth->>SS: verifier またはrefresh token
Auth->>API: exchange / refresh
API-->>Auth: session またはpre-auth
Auth->>API: passkey/bootstrap (Bearerのみ)
API-->>Auth: 短命bootstrap token
Auth->>UI: bootstrap tokenだけをWeb URL fragmentへ渡す
UI->>API: Web options/verify (bootstrap + ceremony headers)
API-->>UI: handoff codeだけ
UI-->>Auth: deep link
Auth->>API: handoff exchange + request_id
Auth->>SS: refresh tokenだけ永続化
Auth-->>Hook: memory-only access token
不変条件:
samuraimeet://auth、開発用Expo schemeだけをallow-listで解析し、一回限りcode以外を受け取らない。buildPasskeyURLのfragmentはbootstrap_tokenだけで、Access/pre-auth tokenは含めない。Web APIはCache-Control: no-storeとReferrer-Policy: no-referrerを返す。