[WEB-1691] chore: refactor finish onboarding logic to avoid multiple redirections. (#4950)

* [WEB-1691] chore: refactor finsh onboarding logic to avoid multiple redirections.

* fix: infinite redirection on visiting onboarding page when the user is not authenticated.

* chore: update intercepter redirect logic.
This commit is contained in:
Prateek Shourya 2024-06-27 18:46:25 +05:30 committed by GitHub
parent 1f9f821543
commit ff4de9ac11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 91 additions and 88 deletions

View file

@ -103,7 +103,7 @@ export const AuthenticationWrapper: FC<TAuthenticationWrapper> = observer((props
} else {
if (currentUser && currentUserProfile?.id && isUserOnboard) {
const currentRedirectRoute = getWorkspaceRedirectionUrl();
router.push(currentRedirectRoute);
router.replace(currentRedirectRoute);
return <></>;
} else return <>{children}</>;
}