Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the token from callback functions #354

Open
Kristian383 opened this issue Nov 24, 2024 · 0 comments
Open

Can't get the token from callback functions #354

Kristian383 opened this issue Nov 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Kristian383
Copy link

📚 What are you trying to do?

Trying to fetch token after user checks the widget, in the development mode using mocked site key for testing.

🔍 What have you tried?

<NuxtTurnstile @success="onCaptchaSuccess" @error="onCaptchaError" @expired="onCaptchaExpired" v-model="captchaToken" ref="turnstile" />

Hello,

I’ve implemented the Turnstile widget as shown above and attached callback functions (@success, @error, and @Expired) to monitor token generation or any relevant messages. However, none of these callbacks seem to trigger.

The widget is visible on the UI.
The nuxt.config.ts file is configured correctly according to the official documentation.
I’ve tried using the mock tokens provided by Cloudflare, including the one that forces an interactive challenge.
I’ve added localhost as a valid hostname in Cloudflare’s Hostname Management.
I've also tried using v-model directive

The problem is:
When I interact with the widget (e.g., checking the checkbox), no network requests are initiated, and the callbacks are not triggered.
Any ideas on what I might be doing wrong? Could it be related to a missing configuration or an issue with how Turnstile is being rendered locally?

Thanks for your help!

ℹ️ Additional context

No response

@maige-app maige-app bot added the bug Something isn't working label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant