MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / fetchSsoProviders

Function fetchSsoProviders

apps/host-selfhost/web/auth-config.ts:18–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 typeof (value as { name?: unknown }).name === "string";
17
18export const fetchSsoProviders = async (): Promise<readonly SsoProvider[]> => {
19 const response = await fetch("/api/auth-config", { credentials: "same-origin" }).then(
20 (r) => r,
21 () => null,
22 );
23 if (!response?.ok) return [];
24 const data = (await response.json().then(
25 (d) => d,
26 () => ({}),
27 )) as { ssoProviders?: unknown };
28 return Array.isArray(data.ssoProviders) ? data.ssoProviders.filter(isSsoProvider) : [];
29};

Callers 1

LoginPageFunction · 0.90

Calls 2

jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected