Callbacks issue in passkey plugin

import { Key } from "lucide-react"
import { Button } from "../ui/button"
import { signIn } from "@/lib/auth-client"
import { useAuthState } from "@/hooks/useAuthState";

export const PasskeyButton = () => {
    const { 
        setSuccess, 
        setError, 
        setLoading, 
        resetState 
    } = useAuthState();
    
    const handlePasskey = async() => {
        try{
            await signIn.passkey({}, {
                onRequest: () => {
                    resetState()
                    setLoading(true)
                },
                onResponse: () => {
                    setLoading(false)
                },
                onError: (ctx) => {
                    setError(ctx.error.message)
                },
                onSuccess: () => {
                    setSuccess("loggedIn Successfully")
                }
            })

        } catch(error) {
            console.log(error)
            setError("Something went wrong")
        }
    }

    return (
        <Button onClick={handlePasskey} className="w-full">
            <Key />
            Sign-in with Passkey
        </Button>
    )
}
Callbacks are not working in passkey plugin
at version 1.1.3 It successfully login the user but can't show message or redirect
Was this page helpful?