mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 13:27:46 +00:00
fix: layout token redirect
This commit is contained in:
@@ -81,7 +81,8 @@ export const registerAuthRoutes = async (server: FastifyZodProvider) => {
|
|||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
token: z.string(),
|
token: z.string(),
|
||||||
organizationId: z.string().optional()
|
organizationId: z.string().optional(),
|
||||||
|
subOrganizationId: z.string().optional()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -131,7 +132,6 @@ export const registerAuthRoutes = async (server: FastifyZodProvider) => {
|
|||||||
appCfg.AUTH_SECRET,
|
appCfg.AUTH_SECRET,
|
||||||
{ expiresIn }
|
{ expiresIn }
|
||||||
);
|
);
|
||||||
|
|
||||||
return { token, organizationId: decodedToken.organizationId, subOrganizationId: decodedToken.subOrganizationId };
|
return { token, organizationId: decodedToken.organizationId, subOrganizationId: decodedToken.subOrganizationId };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
export type GetAuthTokenAPI = {
|
export type GetAuthTokenAPI = {
|
||||||
token: string;
|
token: string;
|
||||||
organizationId?: string;
|
organizationId?: string;
|
||||||
|
subOrganizationId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum UserEncryptionVersion {
|
export enum UserEncryptionVersion {
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ export const Navbar = () => {
|
|||||||
subOrganizationId: subOrgId
|
subOrganizationId: subOrgId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
localStorage.setItem("orgData.id", subOrgId);
|
||||||
|
|
||||||
if (isMfaEnabled) {
|
if (isMfaEnabled) {
|
||||||
SecurityClient.setMfaToken(token);
|
SecurityClient.setMfaToken(token);
|
||||||
if (mfaMethod) {
|
if (mfaMethod) {
|
||||||
|
|||||||
@@ -117,9 +117,10 @@ export const Route = createFileRoute("/_restrict-login-signup")({
|
|||||||
return;
|
return;
|
||||||
throw redirect({ to: "/login/select-organization" });
|
throw redirect({ to: "/login/select-organization" });
|
||||||
}
|
}
|
||||||
|
const orgId = data.subOrganizationId || data.organizationId;
|
||||||
throw redirect({
|
throw redirect({
|
||||||
to: "/organizations/$orgId/projects",
|
to: "/organizations/$orgId/projects",
|
||||||
params: { orgId: data.organizationId }
|
params: { orgId }
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
component: AuthConsentWrapper
|
component: AuthConsentWrapper
|
||||||
|
|||||||
Reference in New Issue
Block a user