From 8e7938838189eaed7e8da581bca50d3c7751771a Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Tue, 27 Aug 2024 22:31:08 -0400 Subject: [PATCH] chore: fix types --- apps/login/src/ui/LoginPasskey.tsx | 5 ++--- apps/login/src/ui/SignInWithIDP.tsx | 5 ----- apps/login/src/ui/ThemeWrapper.tsx | 7 +++---- apps/login/src/ui/UsernameForm.tsx | 4 ++-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/apps/login/src/ui/LoginPasskey.tsx b/apps/login/src/ui/LoginPasskey.tsx index c29d9846d97..fce8ecd8ecb 100644 --- a/apps/login/src/ui/LoginPasskey.tsx +++ b/apps/login/src/ui/LoginPasskey.tsx @@ -8,7 +8,6 @@ import Alert from "./Alert"; import { Spinner } from "./Spinner"; import BackButton from "./BackButton"; import { Checks } from "@zitadel/proto/zitadel/session/v2/session_service_pb"; -import { RequestChallenges } from "@zitadel/proto/zitadel/session/v2/challenge_pb"; // either loginName or sessionId must be provided type Props = { @@ -79,7 +78,7 @@ export default function LoginPasskey({ loginName, sessionId, organization, - challenges: RequestChallenges.fromJson({ + challenges: { webAuthN: { domain: "", // USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = 0; @@ -88,7 +87,7 @@ export default function LoginPasskey({ // USER_VERIFICATION_REQUIREMENT_DISCOURAGED = 3; - mfa userVerificationRequirement: userVerificationRequirement, }, - }), + }, authRequestId, }), }); diff --git a/apps/login/src/ui/SignInWithIDP.tsx b/apps/login/src/ui/SignInWithIDP.tsx index af82aafc5bf..107bb15bbc4 100644 --- a/apps/login/src/ui/SignInWithIDP.tsx +++ b/apps/login/src/ui/SignInWithIDP.tsx @@ -27,11 +27,6 @@ export function SignInWithIDP({ authRequestId, organization, }: 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(); diff --git a/apps/login/src/ui/ThemeWrapper.tsx b/apps/login/src/ui/ThemeWrapper.tsx index c5b99b1ac04..c927bd943b0 100644 --- a/apps/login/src/ui/ThemeWrapper.tsx +++ b/apps/login/src/ui/ThemeWrapper.tsx @@ -1,13 +1,12 @@ "use client"; import { setTheme } from "@/utils/colors"; -import { useEffect } from "react"; +import { ReactNode, useEffect } from "react"; import { BrandingSettings } from "@zitadel/proto/zitadel/settings/v2/branding_settings_pb"; -import { PartialMessage } from "@zitadel/client"; type Props = { - branding: PartialMessage | undefined; - children: React.ReactNode; + branding: BrandingSettings | undefined; + children: ReactNode; }; const ThemeWrapper = ({ children, branding }: Props) => { diff --git a/apps/login/src/ui/UsernameForm.tsx b/apps/login/src/ui/UsernameForm.tsx index 96b719bdfaf..3ea7809f5cf 100644 --- a/apps/login/src/ui/UsernameForm.tsx +++ b/apps/login/src/ui/UsernameForm.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect, useState } from "react"; +import { ReactNode, useEffect, useState } from "react"; import { Button, ButtonVariants } from "./Button"; import { TextInput } from "./Input"; import { useForm } from "react-hook-form"; @@ -24,7 +24,7 @@ type Props = { organization?: string; submit: boolean; allowRegister: boolean; - children?: React.ReactNode; + children?: ReactNode; }; export default function UsernameForm({