This commit is contained in:
Manav Rathi
2024-07-01 11:41:23 +05:30
parent 39a6b3cd6b
commit cd81bbe19e
7 changed files with 22 additions and 39 deletions

View File

@@ -1,6 +1,5 @@
import log from "@/next/log";
import { customAPIHost } from "@/next/origins";
import type { BaseAppContextT } from "@/next/types/context";
import {
checkPasskeyVerificationStatus,
passkeySessionExpiredErrorMessage,
@@ -74,23 +73,18 @@ interface VerifyingPasskeyProps {
email: string | undefined;
/** Called when the user wants to redirect again. */
onRetry: () => void;
/**
* The appContext.
*
* Needs to be explicitly passed since this component is used in a package
* where the pages are not wrapped in the provider.
*/
appContext: BaseAppContextT;
/** Perform the (possibly app specific) logout sequence. */
logout: () => void;
setDialogBoxAttributesV2: (attrs: DialogBoxAttributesV2) => void;
}
export const VerifyingPasskey: React.FC<VerifyingPasskeyProps> = ({
passkeySessionID,
email,
onRetry,
appContext,
logout,
setDialogBoxAttributesV2,
}) => {
const { logout, setDialogBoxAttributesV2 } = appContext;
type VerificationStatus = "waiting" | "checking" | "pending";
const [verificationStatus, setVerificationStatus] =
useState<VerificationStatus>("waiting");