import { observer } from "mobx-react"; import Image from "next/image"; import { useTheme } from "next-themes"; import { KeyRound, Mails } from "lucide-react"; // types import { TGetBaseAuthenticationModeProps, TInstanceAuthenticationMethodKeys, TInstanceAuthenticationModes, } from "@plane/types"; import { resolveGeneralTheme } from "@plane/utils"; // components import { AuthenticationMethodCard } from "@/components/authentication/authentication-method-card"; import { EmailCodesConfiguration } from "@/components/authentication/email-config-switch"; import { GithubConfiguration } from "@/components/authentication/github-config"; import { GitlabConfiguration } from "@/components/authentication/gitlab-config"; import { GoogleConfiguration } from "@/components/authentication/google-config"; import { PasswordLoginConfiguration } from "@/components/authentication/password-config-switch"; // plane admin components import { UpgradeButton } from "@/plane-admin/components/common"; // assets import githubLightModeImage from "@/public/logos/github-black.png"; import githubDarkModeImage from "@/public/logos/github-white.png"; import GitlabLogo from "@/public/logos/gitlab-logo.svg"; import GoogleLogo from "@/public/logos/google-logo.svg"; import OIDCLogo from "@/public/logos/oidc-logo.svg"; import SAMLLogo from "@/public/logos/saml-logo.svg"; export type TAuthenticationModeProps = { disabled: boolean; updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void; }; // Authentication methods export const getAuthenticationModes: (props: TGetBaseAuthenticationModeProps) => TInstanceAuthenticationModes[] = ({ disabled, updateConfig, resolvedTheme, }) => [ { key: "unique-codes", name: "Unique codes", description: "Log in or sign up for Plane using codes sent via email. You need to have set up SMTP to use this method.", icon: , config: , }, { key: "passwords-login", name: "Passwords", description: "Allow members to create accounts with passwords and use it with their email addresses to sign in.", icon: , config: , }, { key: "google", name: "Google", description: "Allow members to log in or sign up for Plane with their Google accounts.", icon: Google Logo, config: , }, { key: "github", name: "GitHub", description: "Allow members to log in or sign up for Plane with their GitHub accounts.", icon: ( GitHub Logo ), config: , }, { key: "gitlab", name: "GitLab", description: "Allow members to log in or sign up to plane with their GitLab accounts.", icon: GitLab Logo, config: , }, { key: "oidc", name: "OIDC", description: "Authenticate your users via the OpenID Connect protocol.", icon: OIDC Logo, config: , unavailable: true, }, { key: "saml", name: "SAML", description: "Authenticate your users via the Security Assertion Markup Language protocol.", icon: SAML Logo, config: , unavailable: true, }, ]; export const AuthenticationModes: React.FC = observer((props) => { const { disabled, updateConfig } = props; // next-themes const { resolvedTheme } = useTheme(); return ( <> {getAuthenticationModes({ disabled, updateConfig, resolvedTheme }).map((method) => ( ))} ); });