From b15dc3946d9f1e457842efbb1fb0bbdaffbd76ae Mon Sep 17 00:00:00 2001 From: hamo-o Date: Mon, 21 Aug 2023 01:23:44 +0900 Subject: [PATCH] fix: add Authorization header --- src/apis/axios.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apis/axios.ts b/src/apis/axios.ts index a615473..a8bd905 100644 --- a/src/apis/axios.ts +++ b/src/apis/axios.ts @@ -11,6 +11,7 @@ export const defaultAxios: AxiosInstance = axios.create({ export const qFeedAxios: AxiosInstance = axios.create({ baseURL: process.env.NEXT_PUBLIC_BASE_URL, headers: { + Authorization: `Bearer ${getCookie()}`, "Content-Type": "application/json;charset=utf-8" } }); @@ -50,8 +51,9 @@ qFeedAxios.interceptors.response.use( } case 502: case 503: - // window.location.href = "/"; - + { + // window.location.href = "/"; + } return Promise.reject(error); } }