cleanup host on idp login

This commit is contained in:
Max Peintner
2024-12-03 10:26:44 +01:00
parent b0f991ac2c
commit d50db37fa2
2 changed files with 3 additions and 7 deletions

View File

@@ -30,10 +30,6 @@ export default async function Page(props: {
}
}
const host = process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: "http://localhost:3000";
const loginSettings = await getLoginSettings(
organization ?? defaultOrganization,
);
@@ -63,7 +59,6 @@ export default async function Page(props: {
>
{identityProviders && (
<SignInWithIdp
host={host}
identityProviders={identityProviders}
authRequestId={authRequestId}
organization={organization ?? defaultOrganization} // use the organization from the searchParams here otherwise fallback to the default organization

View File

@@ -6,6 +6,7 @@ import {
IdentityProvider,
IdentityProviderType,
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
import { headers } from "next/headers";
import { useRouter } from "next/navigation";
import { ReactNode, useState } from "react";
import { Alert } from "./alert";
@@ -18,7 +19,6 @@ import { SignInWithGoogle } from "./idps/sign-in-with-google";
export interface SignInWithIDPProps {
children?: ReactNode;
host: string;
identityProviders: IdentityProvider[];
authRequestId?: string;
organization?: string;
@@ -26,7 +26,6 @@ export interface SignInWithIDPProps {
}
export function SignInWithIdp({
host,
identityProviders,
authRequestId,
organization,
@@ -53,6 +52,8 @@ export function SignInWithIdp({
params.set("organization", organization);
}
const host = (await headers()).get("host");
const response = await startIDPFlow({
idpId,
successUrl: