From fbe349a019d258dd66f2cc020624bbedec32d6f2 Mon Sep 17 00:00:00 2001 From: Kim Min-gyu Date: Thu, 18 Jul 2024 21:50:21 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EC=9E=AC=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/(beforeLogin)/auth/token/page.tsx | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/apps/web/src/app/(beforeLogin)/auth/token/page.tsx b/apps/web/src/app/(beforeLogin)/auth/token/page.tsx index d6b86ba..b0c1fa7 100644 --- a/apps/web/src/app/(beforeLogin)/auth/token/page.tsx +++ b/apps/web/src/app/(beforeLogin)/auth/token/page.tsx @@ -39,34 +39,38 @@ const AuthCallbackPage = ({ const checkUserRegistered = async () => { const userInfo = await userService.userInfo(queryClient) - const isRegistered = userInfo.result.status === UserStatus.Registered - const isOnboardingCompleted = userInfo.result.onboardingCompleted - if (!isOnboardingCompleted) { - router.push('/onboarding/funnel') + if (userInfo.result.status === UserStatus.SocialLoginCompleted) { + router.push('/signup') return } - if (isRegistered && isOnboardingCompleted) { - const sendToken = () => { - window.postMessage( - { - from: 'vook-web', - access, - refresh, - }, - '*', - ) - } + if (userInfo.result.status === UserStatus.Registered) { + if (userInfo.result.onboardingCompleted) { + const sendToken = () => { + window.postMessage( + { + from: 'vook-web', + access, + refresh, + }, + '*', + ) + } - if (window.opener) { - sendToken() - } + if (window.opener) { + sendToken() + } - router.push('/workspace') + router.push('/workspace') + return + } else { + router.push('/onboarding/funnel') + return + } } - if (userInfo.result.onboardingCompleted) { + if (userInfo.result.status === UserStatus.Withdrawn) { router.push('/signup') } }