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; };