Skip to content

Commit

Permalink
hotfix: accessToken 미전달 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
sjsjsj1246 committed Sep 25, 2024
1 parent 60fa708 commit 9e9cdc7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/hooks/auth/useAuth/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'zustand/shallow';
import useAuthStore from './store';
import axiosInstance from '@libs/api/client';
import axiosInstance, { setAccessToken } from '@libs/api/client';
import { demoStart, getAccountMe } from '@libs/api/auth';
import { useLocation, useNavigate } from 'react-router';
import ROUTE from '@libs/constant/path';
Expand Down Expand Up @@ -87,6 +87,12 @@ const useAuth = (activeEffect = false) => {
setState('isAuth', true);
};

useEffect(() => {
if (accessToken) {
setAccessToken(accessToken);
}
}, [accessToken]);

useEffect(() => {
if (_loaded && activeEffect) {
if (demoStartDate && new Date(demoStartDate).getTime() + 3540000 - new Date().getTime() <= 0)
Expand Down

0 comments on commit 9e9cdc7

Please sign in to comment.