Zod schema guard for validating WebAuthn verification records and challenges. Reuse when parsing or validating WebAuthn auth and registration payloads.
// Source: https://github.com/logto-io/logto | License: MPL-2.0 | Copyright under Patent Claims infringed by Covered Software in the absence of | Modified files must remain under MPL-2.0
// Modifications to this file must remain under MPL-2.0.
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';
import { type ToZodObject } from '../../utils/zod.js';
import { bindWebAuthnGuard, type BindWebAuthn } from '../interactions.js';
import { VerificationType } from './verification-type.js';
type BaseWebAuthnVerificationRecordData = {
id: string;
verified: boolean;
/** The challenge generated for the WebAuthn registration */
registrationChallenge?: string;
/** The rpId used when generating the registration options */
registrationRpId?: string;
/**
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key