Skip to content

Commit

Permalink
Fix: [temporary] useAuthStore 호출 시점 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sscoderati committed Jan 16, 2024
1 parent 133f561 commit df5eccd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/apis/axios.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import axios from "axios";
import useAuthStore from "@/store/AuthStore.tsx";

const tokens = useAuthStore.getState().authTokens;

export const axiosAPI = axios.create({
baseURL:
process.env.NODE_ENV === "development"
Expand All @@ -15,7 +13,8 @@ export const axiosAPI = axios.create({

axiosAPI.interceptors.request.use(
(config) => {
config.headers.Authorization = `${tokens?.accessToken}`;
console.log(useAuthStore.getState().authTokens?.accessToken);
config.headers.Authorization = `${useAuthStore.getState().authTokens?.accessToken}`;
return config;
},
(error) => {
Expand Down

0 comments on commit df5eccd

Please sign in to comment.