auth: SSOログイン後の画面遷移とユーザー表示を修正
- コールバック成功時のリダイレクト先をWEB_ORIGINルートから /dashboardに変更(ランディングで止まらないように) - ルートページでログイン済みならダッシュボードへ自動遷移 - サイドバーのユーザーカードをOIDC identityの表示名・メールに変更し、 未ログイン時のみSSOログインリンクを表示 - demoヘッダ(x-demo-user)はdemoモード時のみ送信
This commit is contained in:
@@ -41,7 +41,9 @@ export async function api<T>(path: string, init: RequestInit = {}) {
|
||||
const headers = new Headers(init.headers);
|
||||
headers.set("accept", "application/json");
|
||||
if (init.body) headers.set("content-type", "application/json");
|
||||
Object.entries(DEMO_HEADERS).forEach(([key, value]) => headers.set(key, value));
|
||||
if (AUTH_MODE === "demo") {
|
||||
Object.entries(DEMO_HEADERS).forEach(([key, value]) => headers.set(key, value));
|
||||
}
|
||||
const response = await fetch(`${API_BASE}${path}`, { ...init, headers, credentials: "include" });
|
||||
const body = (await response.json().catch(() => ({}))) as T & { error?: string; detail?: string };
|
||||
if (!response.ok) throw new Error(body.detail || body.error || `Request failed (${response.status})`);
|
||||
|
||||
Reference in New Issue
Block a user