settings service cleanup

This commit is contained in:
Max Peintner
2025-01-14 13:59:30 +01:00
parent 53df6a8c83
commit 92516e695a

View File

@@ -1,17 +1,8 @@
import { DynamicTheme } from "@/components/dynamic-theme";
import { SignInWithIdp } from "@/components/sign-in-with-idp";
import { getBrandingSettings, settingsService } from "@/lib/zitadel";
import { makeReqCtx } from "@zitadel/client/v2";
import { getActiveIdentityProviders, getBrandingSettings } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
function getIdentityProviders(orgId?: string) {
return settingsService
.getActiveIdentityProviders({ ctx: makeReqCtx(orgId) }, {})
.then((resp) => {
return resp.identityProviders;
});
}
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
@@ -22,7 +13,11 @@ export default async function Page(props: {
const authRequestId = searchParams?.authRequestId;
const organization = searchParams?.organization;
const identityProviders = await getIdentityProviders(organization);
const identityProviders = await getActiveIdentityProviders(organization).then(
(resp) => {
return resp.identityProviders;
},
);
const branding = await getBrandingSettings(organization);