From 3c05d5648682af3ca86cf260c772ea027d932296 Mon Sep 17 00:00:00 2001 From: jongse7 Date: Tue, 22 Oct 2024 21:08:56 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B8=B0=EC=A1=B4=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20=EC=82=AC=EC=9A=A9=EC=9E=90=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/kakao/containers/KakaoRedirect.tsx | 4 +++- src/pages/kakao/redirect/containers/RegisterButtonSection.tsx | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/kakao/containers/KakaoRedirect.tsx b/src/pages/kakao/containers/KakaoRedirect.tsx index aa5e140f..784f52d6 100644 --- a/src/pages/kakao/containers/KakaoRedirect.tsx +++ b/src/pages/kakao/containers/KakaoRedirect.tsx @@ -8,7 +8,9 @@ const KakaoRedirect = () => { const setLoginState = useSetRecoilState(LoginState); const AUTHORIZE_CODE: string = new URLSearchParams(window.location.search).get('code')!; - const redirect_url: string | null = new URLSearchParams(window.location.search).get('subServiceUrl') || null; + const urlParams = new URLSearchParams(window.location.search); + + const redirect_url = urlParams.get('subServiceUrl'); console.log(redirect_url); const navigate = useNavigate(); diff --git a/src/pages/kakao/redirect/containers/RegisterButtonSection.tsx b/src/pages/kakao/redirect/containers/RegisterButtonSection.tsx index 29936e07..a805f0e3 100644 --- a/src/pages/kakao/redirect/containers/RegisterButtonSection.tsx +++ b/src/pages/kakao/redirect/containers/RegisterButtonSection.tsx @@ -12,6 +12,8 @@ interface type { export function RegisterButtonSection({ subServiceUrl }: type) { const KAKAO_AUTH_URL = `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${rest_api_key}&redirect_uri=${baseUrl}${redirect_uri}&service_terms=${TAG}&subServiceUrl=${subServiceUrl}`; + console.log(KAKAO_AUTH_URL); + const handleLogin = () => { window.location.href = KAKAO_AUTH_URL; };