Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix(authdomain): sso enabled toggle value from nested config (#11402)

Karan Balani83b25f3e9a37
diff --git a/frontend/src/container/OrganizationSettings/AuthDomain/__tests__/AuthDomain.test.tsx b/frontend/src/container/OrganizationSettings/AuthDomain/__tests__/AuthDomain.test.tsx
index cac1e8dd97..9f9132d3b1 100644
--- a/frontend/src/container/OrganizationSettings/AuthDomain/__tests__/AuthDomain.test.tsx
+++ b/frontend/src/container/OrganizationSettings/AuthDomain/__tests__/AuthDomain.test.tsx
@@ -58,6 +58,26 @@ describe('AuthDomain', () => {
});
});
+ it('reflects ssoEnabled state from nested config in each row toggle', async () => {
+ server.use(
+ rest.get(AUTH_DOMAINS_LIST_ENDPOINT, (_, res, ctx) =>
+ res(ctx.status(200), ctx.json(mockDomainsListResponse)),
+ ),
+ );
+
+ render(<AuthDomain />);
+
+ // mockDomainsListResponse rows:
+ // [0] signoz.io → config.ssoEnabled: true
+ // [1] example.com → config.ssoEnabled: false
+ // [2] corp.io → config.ssoEnabled: true
+ const switches = await screen.findAllByRole('switch');
+ expect(switches).toHaveLength(3);
+ expect(switches[0]).toBeChecked();
+ expect(switches[1]).not.toBeChecked();
+ expect(switches[2]).toBeChecked();
+ });
+
it('renders empty state when no domains exist', async () => {
server.use(
rest.get(AUTH_DOMAINS_LIST_ENDPOINT, (_, res, ctx) =>
diff --git a/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx b/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx
index 483741d55a..8f83a164dc 100644
--- a/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx
+++ b/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx
@@ -121,14 +121,14 @@ function AuthDomain(): JSX.Element {
},
{
title: 'Enforce SSO',
- dataIndex: 'ssoEnabled',
+ dataIndex: ['config', 'ssoEnabled'],
key: 'ssoEnabled',
width: 80,
render: (
value: boolean,
record: AuthtypesGettableAuthDomainDTO,
): JSX.Element => (
- <SSOEnforcementToggle isDefaultChecked={value} record={record} />
+ <SSOEnforcementToggle isDefaultChecked={!!value} record={record} />
),
},
{