Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 16s
CodeQL / Analyze (python) (push) Failing after 3s
i18n sync check / check:sync (push) Failing after 3s
React Doctor / react-doctor (push) Failing after 16s
Branch Build CE / Build-Push Admin Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Admin Manifest (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Web Manifest (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Proxy Manifest (push) Has been cancelled
Branch Build CE / Merge Space Manifest (push) Has been cancelled
Branch Build CE / Prepare AIO Assets (push) Has been cancelled
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Live Collaboration Manifest (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge API Server Manifest (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge AIO Manifest (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
93 lines
3.8 KiB
TypeScript
93 lines
3.8 KiB
TypeScript
/**
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
import { KeyOutline, MailOutline } from "@makeplane/propel/icons";
|
|
// types
|
|
import type {
|
|
TCoreInstanceAuthenticationModeKeys,
|
|
TGetBaseAuthenticationModeProps,
|
|
TInstanceAuthenticationModes,
|
|
} from "@plane/types";
|
|
// assets
|
|
import giteaLogo from "@/app/assets/logos/gitea-logo.svg?url";
|
|
import githubLightModeImage from "@/app/assets/logos/github-black.png?url";
|
|
import githubDarkModeImage from "@/app/assets/logos/github-white.png?url";
|
|
import gitlabLogo from "@/app/assets/logos/gitlab-logo.svg?url";
|
|
import googleLogo from "@/app/assets/logos/google-logo.svg?url";
|
|
// components
|
|
import { EmailCodesConfiguration } from "@/components/authentication/email-config-switch";
|
|
import { GiteaConfiguration } from "@/components/authentication/gitea-config";
|
|
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";
|
|
|
|
// Authentication methods
|
|
export const getCoreAuthenticationModesMap: (
|
|
props: TGetBaseAuthenticationModeProps
|
|
) => Record<TCoreInstanceAuthenticationModeKeys, TInstanceAuthenticationModes> = ({
|
|
disabled,
|
|
updateConfig,
|
|
resolvedTheme,
|
|
}) => ({
|
|
"unique-codes": {
|
|
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: <MailOutline className="h-6 w-6 p-0.5 text-tertiary" />,
|
|
config: <EmailCodesConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "ENABLE_MAGIC_LINK_LOGIN",
|
|
},
|
|
"passwords-login": {
|
|
key: "passwords-login",
|
|
name: "Passwords",
|
|
description: "Allow members to create accounts with passwords and use it with their email addresses to sign in.",
|
|
icon: <KeyOutline className="h-6 w-6 p-0.5 text-tertiary" />,
|
|
config: <PasswordLoginConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "ENABLE_EMAIL_PASSWORD",
|
|
},
|
|
google: {
|
|
key: "google",
|
|
name: "Google",
|
|
description: "Allow members to log in or sign up for Plane with their Google accounts.",
|
|
icon: <img src={googleLogo} height={20} width={20} alt="Google Logo" />,
|
|
config: <GoogleConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GOOGLE_ENABLED",
|
|
},
|
|
github: {
|
|
key: "github",
|
|
name: "GitHub",
|
|
description: "Allow members to log in or sign up for Plane with their GitHub accounts.",
|
|
icon: (
|
|
<img
|
|
src={resolvedTheme === "dark" ? githubDarkModeImage : githubLightModeImage}
|
|
height={20}
|
|
width={20}
|
|
alt="GitHub Logo"
|
|
/>
|
|
),
|
|
config: <GithubConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GITHUB_ENABLED",
|
|
},
|
|
gitlab: {
|
|
key: "gitlab",
|
|
name: "GitLab",
|
|
description: "Allow members to log in or sign up to plane with their GitLab accounts.",
|
|
icon: <img src={gitlabLogo} height={20} width={20} alt="GitLab Logo" />,
|
|
config: <GitlabConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GITLAB_ENABLED",
|
|
},
|
|
gitea: {
|
|
key: "gitea",
|
|
name: "Gitea",
|
|
description: "Allow members to log in or sign up to plane with their Gitea accounts.",
|
|
icon: <img src={giteaLogo} height={20} width={20} alt="Gitea Logo" />,
|
|
config: <GiteaConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GITEA_ENABLED",
|
|
},
|
|
});
|