261030_01_FIX: 인증 전환 시 상태 정리 및 탭 동기화, 외부 링크 권한 오류 시 로그아웃 처리

This commit is contained in:
2026-10-30 15:21:34 +09:00
parent c6cc7edfc7
commit 4bfa2af213
6 changed files with 80 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
import { createHttpClient } from "@kri/common/http";
import { apiError, createHttpClient, redirectToLogout } from "@kri/common/http";
import { clientEnv } from "@/lib/env.client";
const resolveBaseUrl = () =>
@@ -7,6 +7,8 @@ const resolveBaseUrl = () =>
: new URL(clientEnv.API_BASE, window.location.origin).toString();
export const nextApi = createHttpClient(resolveBaseUrl(), {
onForbidden: false,
onForbidden: (error) => {
if (apiError(error).code === "EXTERNAL_SCOPE_DENIED") redirectToLogout();
},
onResponseError: false,
});