mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 11:29:42 +00:00
Fix invite problem on backend
This commit is contained in:
@@ -243,28 +243,7 @@ export const SignupInvitePage = () => {
|
||||
SecurityClient.setSignupToken(response.token);
|
||||
setStep(2);
|
||||
} else {
|
||||
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();
|
||||
navigate({ to: "/login" });
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -74,6 +74,8 @@ export const Route = createFileRoute("/_restrict-login-signup")({
|
||||
middlewares: [stripSearchParams({ callback_port: undefined })]
|
||||
},
|
||||
beforeLoad: async ({ context, location, search }) => {
|
||||
if (location.pathname === "/signupinvite") return;
|
||||
|
||||
if (!context.serverConfig.initialized) {
|
||||
if (location.pathname.endsWith("/admin/signup")) return;
|
||||
throw redirect({ to: "/admin/signup" });
|
||||
@@ -91,8 +93,6 @@ export const Route = createFileRoute("/_restrict-login-signup")({
|
||||
|
||||
setAuthToken(data.token);
|
||||
|
||||
if (location.pathname === "/signupinvite") return;
|
||||
|
||||
// to do cli login
|
||||
if (search?.callback_port) {
|
||||
if (location.pathname.endsWith("select-organization") || location.pathname.endsWith("login"))
|
||||
|
||||
Reference in New Issue
Block a user