From e2680d9aeef3b9e5f60fbf689f62afc2ddecd532 Mon Sep 17 00:00:00 2001 From: x032205 Date: Tue, 3 Jun 2025 21:48:42 -0400 Subject: [PATCH] Insert old code as comment --- .../SignUpInvitePage/SignUpInvitePage.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/frontend/src/pages/auth/SignUpInvitePage/SignUpInvitePage.tsx b/frontend/src/pages/auth/SignUpInvitePage/SignUpInvitePage.tsx index f9dd81f5d..39eb8d686 100644 --- a/frontend/src/pages/auth/SignUpInvitePage/SignUpInvitePage.tsx +++ b/frontend/src/pages/auth/SignUpInvitePage/SignUpInvitePage.tsx @@ -244,6 +244,30 @@ export const SignupInvitePage = () => { setStep(2); } else { navigate({ to: "/login" }); + + // TODO: Redirect user to the newly joined org. The commented code does not work due to auth issues. + // const redirectExistingUser = async () => { + // try { + // const { token: mfaToken, isMfaEnabled } = await selectOrganization({ + // organizationId + // }); + + // if (isMfaEnabled) { + // SecurityClient.setMfaToken(mfaToken); + // toggleShowMfa.on(); + // setMfaSuccessCallback(() => redirectExistingUser); + // return; + // } + + // // user will be redirected to dashboard + // // if not logged in gets kicked out to login + // await navigateUserToOrg(navigate, organizationId); + // } catch (err) { + // navigate({ to: "/login" }); + // } + // }; + + // await redirectExistingUser(); } } } catch (err) {