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