Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Redirect users to SAML portal on change org to SAML org

Tuan Dangfdbf59cd78b6
diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx
index 796ea04e63..d175afe488 100644
--- a/frontend/src/layouts/AppLayout/AppLayout.tsx
+++ b/frontend/src/layouts/AppLayout/AppLayout.tsx
@@ -314,13 +314,16 @@ export const AppLayout = ({ children }: LayoutProps) => {
return (
<DropdownMenuItem key={org.id}>
<Button
- onClick={() => {
+ onClick={async () => {
if (currentOrg?.id === org.id) return;
if (org.authEnforced) {
// org has an org-level auth method enabled (e.g. SAML)
// -> logout + redirect to SAML SSO
- logOutUser();
+
+ await logout.mutateAsync();
+ window.open(`/api/v1/sso/redirect/saml2/organizations/${org.slug}`);
+ window.close();
return;
}