From 246b9ccf5fe2263b261f385e9784c1b323c03275 Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Thu, 6 Jun 2024 23:18:11 -0400 Subject: [PATCH] fix: add todo --- apps/login/src/lib/demos.ts | 2 +- apps/login/src/ui/SessionItem.tsx | 2 ++ apps/login/src/ui/SignInWithIDP.tsx | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/login/src/lib/demos.ts b/apps/login/src/lib/demos.ts index fa0742a46..464bb5788 100644 --- a/apps/login/src/lib/demos.ts +++ b/apps/login/src/lib/demos.ts @@ -35,7 +35,7 @@ export const demos: { name: string; items: Item[] }[] = [ }, { name: "IDP Register", - slug: "register/idp", + slug: "idp", description: "Add a user from an external identity provider", }, ], diff --git a/apps/login/src/ui/SessionItem.tsx b/apps/login/src/ui/SessionItem.tsx index 577bf9dc4..fa13e8654 100644 --- a/apps/login/src/ui/SessionItem.tsx +++ b/apps/login/src/ui/SessionItem.tsx @@ -16,6 +16,8 @@ export default function SessionItem({ reload: () => void; authRequestId?: string; }) { + // TODO: remove casting when bufbuild/protobuf-es@v2 is released + session = Session.fromJson(session as any); const [loading, setLoading] = useState(false); async function clearSession(id: string) { diff --git a/apps/login/src/ui/SignInWithIDP.tsx b/apps/login/src/ui/SignInWithIDP.tsx index 4e7499995..b6f1fe3a3 100644 --- a/apps/login/src/ui/SignInWithIDP.tsx +++ b/apps/login/src/ui/SignInWithIDP.tsx @@ -10,11 +10,12 @@ import { import { useRouter } from "next/navigation"; import { ProviderSlug } from "@/lib/demos"; import Alert from "./Alert"; +import { IdentityProvider } from "@zitadel/proto/zitadel/settings/v2beta/login_settings_pb"; export interface SignInWithIDPProps { children?: ReactNode; host: string; - identityProviders: any[]; + identityProviders: IdentityProvider[]; authRequestId?: string; organization?: string; startIDPFlowPath?: (idpId: string) => string; @@ -30,6 +31,11 @@ export function SignInWithIDP({ organization, startIDPFlowPath = START_IDP_FLOW_PATH, }: SignInWithIDPProps) { + // TODO: remove casting when bufbuild/protobuf-es@v2 is released + identityProviders = identityProviders.map((idp) => + IdentityProvider.fromJson(idp as any), + ); + const [loading, setLoading] = useState(false); const [error, setError] = useState(""); const router = useRouter();