import { useState } from 'react'; import { toast } from 'sonner'; import { KeyRound } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card } from '@/components/Card'; import { useAuth } from 'hooks/useAuth'; export const PasskeyGate = () => { const { user, createPasskeyCredentials } = useAuth(); const [isRegistering, setIsRegistering] = useState(false); const handleRegister = async () => { if (!user || isRegistering) return; setIsRegistering(true); try { await createPasskeyCredentials(user); } catch (ex) { const error = ex as { message?: string }; toast.error(error.message || 'Failed to register passkey. Please try again.'); } finally { setIsRegistering(false); } }; return (

Set up your passkey

Passkeys provide a secure, passwordless way to access your account. Each device or browser needs its own passkey.

); };