Skip to content

Commit

Permalink
chore: move google auth ui behind flag (#3606)
Browse files Browse the repository at this point in the history
Moves the access tab for Google Auth behind a flag. The elements
are still accessible but hidden by default so this is a soft change.
This is a deprecated feature and is on its way out.
  • Loading branch information
sighphyre committed Apr 26, 2023
1 parent 1fdf68e commit 9521c45
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/component/admin/auth/AuthSettings.tsx
Expand Up @@ -11,6 +11,7 @@ import { TabNav } from 'component/common/TabNav/TabNav/TabNav';

export const AuthSettings = () => {
const { authenticationType } = useUiConfig().uiConfig;
const { uiConfig } = useUiConfig();

const tabs = [
{
Expand All @@ -29,7 +30,9 @@ export const AuthSettings = () => {
label: 'Google',
component: <GoogleAuth />,
},
];
].filter(
item => uiConfig.flags?.googleAuthEnabled || item.label !== 'Google'
);

return (
<div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/interfaces/uiConfig.ts
Expand Up @@ -51,6 +51,7 @@ export interface IFlags {
demo?: boolean;
strategyTitle?: boolean;
groupRootRoles?: boolean;
googleAuthEnabled?: boolean;
}

export interface IVersionInfo {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/__snapshots__/create-config.test.ts.snap
Expand Up @@ -75,6 +75,7 @@ exports[`should create default config 1`] = `
"embedProxy": true,
"embedProxyFrontend": true,
"featuresExportImport": true,
"googleAuthEnabled": false,
"groupRootRoles": false,
"maintenanceMode": false,
"messageBanner": false,
Expand All @@ -101,6 +102,7 @@ exports[`should create default config 1`] = `
"embedProxy": true,
"embedProxyFrontend": true,
"featuresExportImport": true,
"googleAuthEnabled": false,
"groupRootRoles": false,
"maintenanceMode": false,
"messageBanner": false,
Expand Down
4 changes: 4 additions & 0 deletions src/lib/types/experimental.ts
Expand Up @@ -80,6 +80,10 @@ const flags = {
process.env.UNLEASH_STRATEGY_TITLE,
false,
),
googleAuthEnabled: parseEnvVarBoolean(
process.env.GOOGLE_AUTH_ENABLED,
false,
),
};

export const defaultExperimentalOptions: IExperimentalOptions = {
Expand Down

0 comments on commit 9521c45

Please sign in to comment.