Skip to content

Commit bb6b60c

Browse files
authored
fix: manual logout flow (#5862)
1 parent 7d8d134 commit bb6b60c

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

packages/shared/src/contexts/AuthContext.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import React, {
99
import type { QueryObserverResult } from '@tanstack/react-query';
1010
import { useRouter } from 'next/router';
1111
import type { AnonymousUser, LoggedUser } from '../lib/user';
12-
import {
13-
deleteAccount,
14-
logout as dispatchLogout,
15-
LogoutReason,
16-
} from '../lib/user';
12+
import { deleteAccount, logout as dispatchLogout } from '../lib/user';
1713
import type { AccessToken, Boot, Visit } from '../lib/boot';
1814
import { isCompanionActivated } from '../lib/element';
1915
import type { AuthTriggersType } from '../lib/auth';
@@ -161,21 +157,6 @@ export const AuthContextProvider = ({
161157
const referralOrigin = user?.referralOrigin;
162158
const router = useRouter();
163159
const isFunnelRef = useRef(!!router?.pathname?.startsWith(webFunnelPrefix));
164-
const isRecruiterPage = router?.pathname?.startsWith('/recruiter');
165-
const isAuthTransitPage =
166-
router?.pathname === '/callback' || router?.pathname === '/onboarding';
167-
168-
if (
169-
firstLoad === true &&
170-
endUser &&
171-
!endUser?.infoConfirmed &&
172-
!isFunnelRef.current &&
173-
!isRecruiterPage &&
174-
!isAuthTransitPage
175-
) {
176-
logout(LogoutReason.IncomleteOnboarding);
177-
}
178-
179160
const isValidRegion = useMemo(
180161
() => !invalidPlusRegions.includes(geo?.region),
181162
[geo?.region],

0 commit comments

Comments
 (0)