michaelvs97 / AspNetCore.ReCaptcha

Google ReCAPTCHA v2/v3 Library for .NET Core 3.x/5.x
https://www.nuget.org/packages/AspNetCore.ReCaptcha/
MIT License
73 stars 20 forks source link

grecaptcha is not defined error #70

Closed jfsanchez2k closed 1 month ago

jfsanchez2k commented 1 month ago

When implementing V3, an error "grecaptcha is not defined"

This code works with V2, but get the error with V3

        @if (ReCaptchaSettings.Value.Enabled)
        {
            ReCaptchaSettings.Value.Version = Model.Merchant.RecaptchaVersion ?? ReCaptchaSettings.Value.Version;
            <div class="form-group m-0 p-0 d-flex">
                @if (ReCaptchaSettings.Value.Version == ReCaptchaVersion.V2)
                {
                    @Html.ReCaptcha(language: culture.Name)
                }
                else if (ReCaptchaSettings.Value.Version == ReCaptchaVersion.V3)
                {
                    @* <recaptcha language="@culture.Name" /> *@
                    @Html.ReCaptcha(language: culture.Name)
                }
            </div>
        }

Captura de pantalla 2024-09-04 003744