delete user with password doesn't work if sendDeleteAccountVerification is set up

As the title says. I'm trying to implement user deletion with both: password (for credentials & phoneNumber users) & email verification (for OAuth users). I set up sendDeleteAccountVerification, deleting account by sendingDeleteVerification works, but by using password doesn't work. It just gives success state (if the password is correct) but doesn't work..
auth.ts:
user: {
  deleteUser: {
  sendDeleteAccountVerification: async ({ user, url, token }, request) => {
          await sendDeleteAccountVerificationEmail({
            email: user.email,
            name: user.name,
            deletionUrl: url,
          });
        },
        enabled: true,
    }
  }
}

delete-user-dialog.tsx
const handleDelete = async (e: React.FormEvent) => {
    e.preventDefault();
    setError(null);

    startTransition(async () => {
      
      if (userHasPassword){
      await authClient.deleteUser({
        password,
        fetchOptions: {
          onSuccess: (ctx) => {
            toast.success("Your account has been deleted successfully.");
            setOpen(false);
          },
          onError: (ctx) => {
            setError(ctx.error.message);
          },
        },
      });
    }else{
      await authClient.deleteUser({
        callbackURL: "/goodbye",
        fetchOptions: {
          onSuccess: (ctx) => {
            toast.success("Verification email sent! Please check your inbox.");
            setOpen(false);
          },
          onError: (ctx) => {
            setError(ctx.error.message);
          },
        },
      });
    }
    });
  };
Was this page helpful?