babaktaremi / GoogleCaptchaComponent

🤖 Implementation of google reCaptcha as a blazor component with support of reCaptcha-V2 and reCaptcha-V3 and server validation
MIT License
77 stars 13 forks source link

reCAPTCHA couldn't find user-provided function: onloadCallback #19

Closed innovadev2024 closed 4 months ago

innovadev2024 commented 4 months ago

Hello, I have a problem with the component the captcha not show and got this error, I using net core 8 blazor server mode

reCAPTCHA couldn't find user-provided function: onloadCallback

Thanks for any help

babaktaremi commented 4 months ago

Hi. Need more info. Which version are you using? can you provide the project or code snippet?

innovadev2024 commented 4 months ago

Hi. Beed more info. Which version are yoylu using? can provide the project or code snippet?

Hi I can't provide the project unfortunately, but if this helps I use net core 8 with blazor server mode, I try to use captcha V3

babaktaremi commented 4 months ago

Hi. Beed more info. Which version are yoylu using? can provide the project or code snippet?

Hi I can't provide the project unfortunately, but if this helps I use net core 8 with blazor server mode, I try to use captcha V3

What rendering mode is configured for the page using the captcha?

innovadev2024 commented 4 months ago

Hi. Beed more info. Which version are yoylu using? can provide the project or code snippet?

Hi I can't provide the project unfortunately, but if this helps I use net core 8 with blazor server mode, I try to use captcha V3

What rendering mode is configured for the page using the captcha?

@rendermode InteractiveServer those are the errors that I have.

image

babaktaremi commented 4 months ago

Set the detailed errors to true. This information does not help

innovadev2024 commented 4 months ago

Set the detailed errors to true. This information does not help

here the details

image

babaktaremi commented 4 months ago

Set the detailed errors to true. This information does not help

here the details

image

have you referenced the loader script in .html file?

<script src="_content/GoogleCaptchaComponent/Scripts/ScriptLoader.js"></script>
innovadev2024 commented 4 months ago

Set the detailed errors to true. This information does not help

here the details image

have you referenced the loader script in .html file?

<script src="_content/GoogleCaptchaComponent/Scripts/ScriptLoader.js"></script>

in the case of the server mode for blazor, doesn't have a html page, I try to add then href in the MainLayout.razor but I think doesn't work

image

innovadev2024 commented 4 months ago

I found the problem I need to put the script in the App.razor and now it works thank you.

image