From e814984365d6582afb778c20f8d4be908ef5c64f Mon Sep 17 00:00:00 2001 From: afds4567 <33995840+afds4567@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:32:00 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20routepage=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/KaKaoRedirectPage.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/KaKaoRedirectPage.tsx b/frontend/src/pages/KaKaoRedirectPage.tsx index e3708b484..14f5d6ec2 100644 --- a/frontend/src/pages/KaKaoRedirectPage.tsx +++ b/frontend/src/pages/KaKaoRedirectPage.tsx @@ -7,7 +7,6 @@ import { LoginResponse } from '../types/Login'; export const handleOAuthKakao = async (code: string) => { console.log('hi'); - const { routePage } = useNavigator(); console.log('bye'); try { console.log('222'); @@ -19,13 +18,14 @@ export const handleOAuthKakao = async (code: string) => { localStorage.setItem('user', JSON.stringify(data.member)); window.alert('login process'); - routePage('/'); } catch (error) { window.alert('로그인 실패'); } }; const KakaoRedirectPage = () => { + const { routePage } = useNavigator(); + const location = useLocation(); console.log('location', location); @@ -39,6 +39,7 @@ const KakaoRedirectPage = () => { if (code) { console.log('ifCode', code); ab(code); + routePage('/'); console.log('ab'); } }, [location]);