File tree Expand file tree Collapse file tree 4 files changed +18
-29
lines changed
Expand file tree Collapse file tree 4 files changed +18
-29
lines changed Original file line number Diff line number Diff line change 11'use client' ;
2- import { router } from '@/routes/router' ;
3- import { refreshAuthAtom } from '@/store/auth' ;
4- import { useSetAtom } from 'jotai' ;
5- import { useEffect } from 'react' ;
2+
63import { RouterProvider } from 'react-router-dom' ;
74
5+ import { router } from '@/routes/router' ;
6+
87export const App = ( ) => {
9- const refreshAuth = useSetAtom ( refreshAuthAtom ) ;
8+ // const refreshAuth = useSetAtom(refreshAuthAtom);
109
11- useEffect ( ( ) => {
12- refreshAuth ( ) ;
13- } , [ ] ) ;
10+ // useEffect(() => {
11+ // refreshAuth();
12+ // }, []);
1413
1514 return < RouterProvider router = { router } /> ;
16- } ;
15+ } ;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ apiInstance.interceptors.response.use(
116116 } )
117117 . catch ( ( reissueError : AxiosError ) => {
118118 processQueue ( reissueError ) ;
119- navigate ( PATH . LOGIN ) ;
119+ // navigate(PATH.LOGIN);
120120
121121 console . error ( 'reissue error' , reissueError ) ;
122122 return Promise . reject ( reissueError ) ;
@@ -128,7 +128,6 @@ apiInstance.interceptors.response.use(
128128
129129 // 리프레시 토큰이 만료됨
130130 // sessionStorage.removeItem('Authorization');
131- navigate ( PATH . LOGIN ) ;
132131 return Promise . reject ( error ) ;
133132 }
134133 }
Original file line number Diff line number Diff line change @@ -23,18 +23,10 @@ export const createProfile = async ({
2323 memberExplain,
2424 image,
2525} : ProfileMutationArgs ) => {
26- const formData = new FormData ( ) ;
27-
28- formData . append ( 'memberName' , memberName ) ;
29- formData . append ( 'memberExplain' , memberExplain ) ;
30- if ( image ) {
31- formData . append ( 'image' , image ) ;
32- }
33-
34- const res = await apiInstance . post ( 'v1/members' , formData , {
35- headers : {
36- 'Content-Type' : 'multipart/form-data' ,
37- } ,
26+ const res = await apiInstance . post ( 'v1/members' , {
27+ memberName,
28+ memberExplain,
29+ image,
3830 } ) ;
3931
4032 return res . data ;
Original file line number Diff line number Diff line change @@ -30,19 +30,20 @@ import { useAtom } from 'jotai';
3030
3131const useAuth = ( ) => {
3232 const [ isLoggedIn ] = useAtom ( isLoggedInAtom ) ;
33+ console . log ( 'useAuth isLoggedIn' , isLoggedIn ) ;
3334 // if (isDevMode()) {
3435 // return {
3536 // isAuthenticated: true,
3637 // };
3738 // }
38- console . log ( 'isLoggedIn' , isLoggedIn ) ;
3939 return {
4040 isAuthenticated : isLoggedIn ,
4141 } ;
4242} ;
4343
4444const PrivateRoute = ( { children } : { children : React . ReactNode } ) => {
4545 const { isAuthenticated } = useAuth ( ) ;
46+ console . log ( 'PrivateRoute isAuthenticated' , isAuthenticated ) ;
4647 const location = useLocation ( ) ;
4748
4849 if ( ! isAuthenticated ) {
@@ -113,11 +114,9 @@ export const router = createBrowserRouter(
113114 {
114115 path : PATH . ENROLL ,
115116 element : (
116- < PrivateRoute >
117- < Suspense fallback = { < LazySkeleton /> } >
118- < LazyEnrollTemplate />
119- </ Suspense >
120- </ PrivateRoute >
117+ < Suspense fallback = { < LazySkeleton /> } >
118+ < LazyEnrollTemplate />
119+ </ Suspense >
121120 ) ,
122121 } ,
123122 {
You can’t perform that action at this time.
0 commit comments