Skip to content

Commit

Permalink
fix: token 없을 때 Authorization 빈 객체로 세팅하여 비로그인 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
semnil5202 committed Jan 16, 2024
1 parent 8db43f2 commit 4b3e0f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/apis/new/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response> | null = null;
Expand Down

0 comments on commit 4b3e0f9

Please sign in to comment.