diff --git a/frontend/src/component/admin/auth/AuthSettings.tsx b/frontend/src/component/admin/auth/AuthSettings.tsx index df267cae2de0..35b4b6eddd41 100644 --- a/frontend/src/component/admin/auth/AuthSettings.tsx +++ b/frontend/src/component/admin/auth/AuthSettings.tsx @@ -11,6 +11,7 @@ import { TabNav } from 'component/common/TabNav/TabNav/TabNav'; export const AuthSettings = () => { const { authenticationType } = useUiConfig().uiConfig; + const { uiConfig } = useUiConfig(); const tabs = [ { @@ -29,7 +30,9 @@ export const AuthSettings = () => { label: 'Google', component: , }, - ]; + ].filter( + item => uiConfig.flags?.googleAuthEnabled || item.label !== 'Google' + ); return (
diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 307d2b26e8e1..e1c21447f82d 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -51,6 +51,7 @@ export interface IFlags { demo?: boolean; strategyTitle?: boolean; groupRootRoles?: boolean; + googleAuthEnabled?: boolean; } export interface IVersionInfo { diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 43a275dbc557..9801dd9fcec0 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -75,6 +75,7 @@ exports[`should create default config 1`] = ` "embedProxy": true, "embedProxyFrontend": true, "featuresExportImport": true, + "googleAuthEnabled": false, "groupRootRoles": false, "maintenanceMode": false, "messageBanner": false, @@ -101,6 +102,7 @@ exports[`should create default config 1`] = ` "embedProxy": true, "embedProxyFrontend": true, "featuresExportImport": true, + "googleAuthEnabled": false, "groupRootRoles": false, "maintenanceMode": false, "messageBanner": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 5c7712ebd98e..14431a235748 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -80,6 +80,10 @@ const flags = { process.env.UNLEASH_STRATEGY_TITLE, false, ), + googleAuthEnabled: parseEnvVarBoolean( + process.env.GOOGLE_AUTH_ENABLED, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {