diff --git a/src/frontend/apps/web/src/shared/services/apis/fetch-instance.api.ts b/src/frontend/apps/web/src/shared/services/apis/fetch-instance.api.ts index 61ce4dcd..408f39a2 100644 --- a/src/frontend/apps/web/src/shared/services/apis/fetch-instance.api.ts +++ b/src/frontend/apps/web/src/shared/services/apis/fetch-instance.api.ts @@ -1,3 +1,5 @@ +'use server'; + import { ERROR_MESSAGES } from '@/src/shared/services/models'; import type { HttpMethod, @@ -8,6 +10,7 @@ import type { ApiServerType, } from '@/src/shared/services/models'; import { getBaseUrl } from '@/src/shared/services/lib/utils'; +import { cookies } from 'next/headers'; export async function fetchInstance( serverType: ApiServerType, @@ -16,9 +19,7 @@ export async function fetchInstance( options: FetchOptions = {}, ): Promise { try { - // 🟒 λΈŒλΌμš°μ € ν™˜κ²½μ—μ„œλ§Œ localStorage μ ‘κ·Ό - const token = - typeof window !== 'undefined' ? localStorage.getItem('token') : null; + const token = cookies().get('token')?.value; // 🟒 options κ°μ²΄μ—μ„œ ν•„μš”ν•œ 값듀을 ꡬ쑰 λΆ„ν•΄ ν• λ‹Ή const {