diff --git a/frontend/src/assets/icons/google.svg b/frontend/src/assets/icons/google.svg deleted file mode 100644 index f9c6f88d2b..0000000000 --- a/frontend/src/assets/icons/google.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryTable.tsx b/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryTable.tsx index ff152e3881..0c5d91cd8c 100644 --- a/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryTable.tsx +++ b/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryTable.tsx @@ -44,6 +44,7 @@ const AUTH_TYPE_LABEL: { [key: string]: string } = { oidc: 'OIDC', saml: 'SAML', google: 'Google', + github: 'GitHub', }; export const LoginHistoryTable = () => { diff --git a/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx b/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx index ad3c22fb77..da50cc1bdb 100644 --- a/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx +++ b/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx @@ -1,12 +1,12 @@ import { Button } from '@mui/material'; import classnames from 'classnames'; import { useThemeStyles } from 'themes/themeStyles'; -import { ReactComponent as GoogleSvg } from 'assets/icons/google.svg'; import LockRounded from '@mui/icons-material/LockRounded'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import type { IAuthOptions } from 'hooks/api/getters/useAuth/useAuthEndpoint'; import { SSO_LOGIN_BUTTON } from 'utils/testIds'; import useQueryParams from 'hooks/useQueryParams'; +import GoogleIcon from '@mui/icons-material/Google'; +import GitHubIcon from '@mui/icons-material/GitHub'; interface IAuthOptionProps { options?: IAuthOptions[]; @@ -19,6 +19,37 @@ function addOrOverwriteRedirect(path: string, redirectValue: string): string { return `${basePath}?${params.toString()}`; } +const renderStartIcon = ({ type }: IAuthOptions) => { + if (type === 'google') { + return ( + + ); + } else if (type === 'github') { + return ( + + ); + } + + return ( + + ); +}; + const AuthOptions = ({ options }: IAuthOptionProps) => { const { classes: themeStyles } = useThemeStyles(); const query = useQueryParams(); @@ -48,27 +79,7 @@ const AuthOptions = ({ options }: IAuthOptionProps) => { style={{ height: '40px', }} - startIcon={ - - } - elseShow={ - - } - /> - } + startIcon={renderStartIcon(o)} > {o.message} diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 3217aaa06f..cae6630c2b 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -64,7 +64,8 @@ export type IFlagKey = | 'eventGrouping' | 'paygInstanceStatsEvents' | 'timestampsInChangeRequestTimeline' - | 'lifecycleGraphs'; + | 'lifecycleGraphs' + | 'githubAuth'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -300,6 +301,10 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_LIFECYCLE_GRAPHS, false, ), + githubAuth: parseEnvVarBoolean( + process.env.UNLEASH_EXPERIMENTAL_GITHUB_AUTH, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {