import { getLegalAndSupportSettings, getLoginSettings, server, } from "#/lib/zitadel"; import { SignInWithIDP } from "#/ui/SignInWithIDP"; import UsernameForm from "#/ui/UsernameForm"; import { GetActiveIdentityProvidersResponse, IdentityProvider, ZitadelServer, settings, } from "@zitadel/server"; function getIdentityProviders( server: ZitadelServer, orgId?: string ): Promise { const settingsService = settings.getSettings(server); return settingsService .getActiveIdentityProviders( orgId ? { ctx: { orgId } } : { ctx: { instance: true } }, {} ) .then((resp: GetActiveIdentityProvidersResponse) => { return resp.identityProviders; }); } export default async function Page({ searchParams, }: { searchParams: Record; }) { const loginName = searchParams?.loginName; const authRequestId = searchParams?.authRequestId; const organization = searchParams?.organization; const submit: boolean = searchParams?.submit === "true"; const loginSettings = await getLoginSettings(server, organization); const legal = await getLegalAndSupportSettings(server); // TODO if org idps should be shown replace emptystring with the orgId. const identityProviders = await getIdentityProviders(server, ""); const host = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "http://localhost:3000"; return (

Welcome back!

Enter your login data.

{legal && identityProviders && process.env.ZITADEL_API_URL && ( )}
); }