From 4b3e0f919d6168e28cc82b7da2e4cf30f0112ab9 Mon Sep 17 00:00:00 2001 From: semnil5202 Date: Tue, 16 Jan 2024 22:29:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20token=20=EC=97=86=EC=9D=84=20=EB=95=8C?= =?UTF-8?q?=20Authorization=20=EB=B9=88=20=EA=B0=9D=EC=B2=B4=EB=A1=9C=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85=ED=95=98=EC=97=AC=20=EB=B9=84=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/apis/new/http.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/apis/new/http.ts b/frontend/src/apis/new/http.ts index 4060c984b..ab6ca8f64 100644 --- a/frontend/src/apis/new/http.ts +++ b/frontend/src/apis/new/http.ts @@ -6,9 +6,11 @@ import axios, { const API_POSTFIX = 'api'; const BASE_URL = process.env.APP_URL || `https://mapbefine.com/${API_POSTFIX}`; +const token = localStorage.getItem('userToken'); + const axiosInstance = axios.create({ baseURL: BASE_URL, - headers: { Authorization: `Bearer ${localStorage.getItem('userToken')}` }, + headers: token ? { Authorization: `Bearer ${token}` } : {}, }); let refreshResponse: Promise | null = null;