diff --git a/src/apis/AxiosInstance.ts b/src/apis/AxiosInstance.ts index 2640c24..a21f9eb 100644 --- a/src/apis/AxiosInstance.ts +++ b/src/apis/AxiosInstance.ts @@ -10,15 +10,14 @@ class Service { baseURL: API_BASE_URL, headers: { 'Content-Type': 'application/json', - Authorization: - typeof window !== 'undefined' - ? `${localStorage.getItem('access_token')}` - : '', }, }) if (typeof window !== 'undefined') { - this.http.defaults.headers.common.Authorization = `${localStorage.getItem('access_token')}` + const token = localStorage.getItem('access_token') + if (token) { + this.http.defaults.headers.common.Authorization = `${token}` + } } } }