261030_01_FIX: 인증 전환 시 상태 정리 및 탭 동기화, 외부 링크 권한 오류 시 로그아웃 처리
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user