From 99646b5966d67ed5762c6bda17e958dc129a00c4 Mon Sep 17 00:00:00 2001 From: urjimyu <92876819+urjimyu@users.noreply.github.com> Date: Mon, 27 May 2024 23:05:49 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=BD=98=EC=86=94=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/queries/usePostKakao.tsx | 4 ++-- src/pages/KakaoLoginPage.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hooks/queries/usePostKakao.tsx b/src/hooks/queries/usePostKakao.tsx index 8bacdc5..18834e8 100644 --- a/src/hooks/queries/usePostKakao.tsx +++ b/src/hooks/queries/usePostKakao.tsx @@ -20,8 +20,8 @@ const usePostKakao = () => { console.log('data', data); setKakaoResponse(data.data); // console.log('응답이 왔나요?', kakaoResponse); - // localStorage.setItem('ACCESS_TOKEN', data.data.accessToken); - // localStorage.setItem('REFRESH_TOKEN', data.data.refreshToken); + localStorage.setItem('ACCESS_TOKEN', data.data.accessToken); + localStorage.setItem('REFRESH_TOKEN', data.data.refreshToken); } catch (err) { setKakaoError(err as AxiosError); console.log('에러 발생', err); diff --git a/src/pages/KakaoLoginPage.tsx b/src/pages/KakaoLoginPage.tsx index d8cb240..984d4de 100644 --- a/src/pages/KakaoLoginPage.tsx +++ b/src/pages/KakaoLoginPage.tsx @@ -17,7 +17,7 @@ const KakaoLoginPage = () => { const res = await useGetToken(); if (res) { const token = res.data.access_token; - + console.log('token 잘 왔나요?', token); // localStorage.setItem('ACCESS_TOKEN', JSON.stringify(token)); // await handlePostKakao(token); await postKakao(token); @@ -29,10 +29,12 @@ const KakaoLoginPage = () => { useEffect(() => { fetchLogin(); + console.log('몇 번 불리는지'); }, [fetchLogin]); useEffect(() => { if (!kakaoLoading && kakaoResponse) { + console.log('여기서는 잘 들어오나?', kakaoResponse); if (kakaoResponse.isAlreadyUser) { navigate('/delete'); } else {