Files
docmost_custom/apps/client/src/ee/security/components/sso-provider-modal.tsx
T
Philip Okugbe dcbb65d799 feat(EE): LDAP integration (#1515)
* LDAP - WIP

* WIP

* add hasGeneratedPassword

* fix jotai atom

* - don't require password confirmation for MFA is user has auto generated password (LDAP)
- cleanups

* fix

* reorder

* update migration

* update default

* fix type error
2025-09-02 04:59:01 +01:00

49 lines
1.3 KiB
TypeScript

import React from "react";
import { Modal } from "@mantine/core";
import { IAuthProvider } from "@/ee/security/types/security.types.ts";
import { SsoSamlForm } from "@/ee/security/components/sso-saml-form.tsx";
import { SSO_PROVIDER } from "@/ee/security/contants.ts";
import { SsoOIDCForm } from "@/ee/security/components/sso-oidc-form.tsx";
import { SsoGoogleForm } from "@/ee/security/components/sso-google-form.tsx";
import { SsoLDAPForm } from "@/ee/security/components/sso-ldap-form.tsx";
interface SsoModalProps {
opened: boolean;
onClose: () => void;
provider: IAuthProvider | null;
}
export default function SsoProviderModal({
opened,
onClose,
provider,
}: SsoModalProps) {
if (!provider) {
return null;
}
return (
<Modal
opened={opened}
title={`${provider.type.toUpperCase()} Configuration`}
onClose={onClose}
>
{provider.type === SSO_PROVIDER.SAML && (
<SsoSamlForm provider={provider} onClose={onClose} />
)}
{provider.type === SSO_PROVIDER.OIDC && (
<SsoOIDCForm provider={provider} onClose={onClose} />
)}
{provider.type === SSO_PROVIDER.GOOGLE && (
<SsoGoogleForm provider={provider} onClose={onClose} />
)}
{provider.type === SSO_PROVIDER.LDAP && (
<SsoLDAPForm provider={provider} onClose={onClose} />
)}
</Modal>
);
}