Skip to content

Commit

Permalink
hotfix: 재가입 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
cobocho committed Jul 18, 2024
1 parent 08a1265 commit fbe349a
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions apps/web/src/app/(beforeLogin)/auth/token/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
Expand Down

0 comments on commit fbe349a

Please sign in to comment.