diff --git a/site/src/pages/DeploymentSettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.stories.tsx b/site/src/pages/DeploymentSettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.stories.tsx index d8c3e0d49b..fac9a52988 100644 --- a/site/src/pages/DeploymentSettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.stories.tsx +++ b/site/src/pages/DeploymentSettingsPage/UserAuthSettingsPage/UserAuthSettingsPageView.stories.tsx @@ -26,6 +26,17 @@ const meta: Meta = { flag_shorthand: "o", hidden: false, }, + { + name: "OIDC Client Secret", + description: "Client secret to use for Login with OIDC.", + value: "", + value_source: "env", + env: "CODER_OIDC_CLIENT_SECRET", + group: oidcGroup, + flag: "oidc-client-secret", + annotations: { secret: "true" }, + hidden: false, + }, { name: "OIDC Allow Signups", description: "Whether new users can sign up with OIDC.", @@ -72,6 +83,16 @@ const meta: Meta = { flag_shorthand: "o", hidden: false, }, + { + name: "OAuth2 GitHub Client Secret", + description: "Client secret for Login with GitHub.", + value: "", + value_source: "flag", + group: ghGroup, + flag: "oauth2-github-client-secret", + annotations: { secret: "true" }, + hidden: false, + }, { name: "OAuth2 GitHub Allow Signups", description: "Whether new users can sign up with GitHub.", diff --git a/site/src/pages/DeploymentSettingsPage/optionValue.test.ts b/site/src/pages/DeploymentSettingsPage/optionValue.test.ts index ddb94fd423..71cd6cfa05 100644 --- a/site/src/pages/DeploymentSettingsPage/optionValue.test.ts +++ b/site/src/pages/DeploymentSettingsPage/optionValue.test.ts @@ -147,6 +147,25 @@ describe("optionValue", () => { }, expected: 30000000000, }, + { + option: { + ...defaultOption, + name: "OIDC Client Secret Is Set", + value: "", + value_source: "env", + annotations: { secret: "true" }, + }, + expected: "Set", + }, + { + option: { + ...defaultOption, + name: "OIDC Client Secret Is Not Set", + value: "", + annotations: { secret: "true" }, + }, + expected: "", + }, ])( "[$option.name]optionValue($option.value)", ({ option, expected, additionalValues }) => { diff --git a/site/src/pages/DeploymentSettingsPage/optionValue.ts b/site/src/pages/DeploymentSettingsPage/optionValue.ts index 18b4309040..56aeac6849 100644 --- a/site/src/pages/DeploymentSettingsPage/optionValue.ts +++ b/site/src/pages/DeploymentSettingsPage/optionValue.ts @@ -13,6 +13,10 @@ export function optionValue( continue; // skip if not explicitly true } switch (k) { + case "secret": + // For secret fields, show "Set" if configured, otherwise show empty + // (which will be rendered as "Not set" by OptionValue component) + return option.value_source ? "Set" : ""; case "format_duration": return humanDuration((option.value as number) / 1e6); // Add additional cases here as needed.