Coder Social home page Coder Social logo

Comments (10)

agiletools avatar agiletools commented on June 2, 2024 4

@shelland Thank you!
I have this problem too. I use Razor Pages.

It helps me::
@(Html.Recaptcha(RecaptchaSettings.Value, new RecaptchaV3HiddenInput { IsAsync = false }))

from recaptcha.aspnetcore.

shelland avatar shelland commented on June 2, 2024 3

@TimothyMeadows

Seems like I could found a reason of this issue:

grecaptcha.ready is not being called because main JS file is loaded using "async defer". Recaptcha documentation says that you should embed JS script in the following way:

<script src="https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key"></script>

without "async defer" attributes. In this case everything works correctly. Currently JS file is linked with the following code:

<script src="https://www.google.com/recaptcha/api.js?render=SOME_KEY&hl=en" async defer></script>

from recaptcha.aspnetcore.

TimothyMeadows avatar TimothyMeadows commented on June 2, 2024 1

Added a link to the bottom of readme for this issue, and other special cases.

from recaptcha.aspnetcore.

maatj05 avatar maatj05 commented on June 2, 2024 1

perhaps unnecessarily but V3HiddenInput is in the 'versions' namespace and not in the 'templates' namespace

from recaptcha.aspnetcore.

TimothyMeadows avatar TimothyMeadows commented on June 2, 2024

Hi, i guess please make sure you are using the updated version of the package for 3.1. Other wise if you have already done this, you would need more information about how you are using it. V3Invis should have a logo on the right hand corner of the page (recaptcha logo) if you don't see that check the console in you browser for errors. Normally an empty response on happens if the page sits for too long.

If you are still having issues please post more examples of how your using (just a small block of code around the @html tag etc.. hopefully others can help as well.

from recaptcha.aspnetcore.

Panzerfury avatar Panzerfury commented on June 2, 2024

I'm using the latest version of the package. The recaptcha logo is also at the buttom of the page.

Here is a small code sample

<div class="form-group">
        <div class="column" style="direction: rtl;">
            @(Html.Recaptcha<RecaptchaV3HiddenInput>(RecaptchaSettings.Value))
        </div>
    </div>

This code is inside a form.

from recaptcha.aspnetcore.

shelland avatar shelland commented on June 2, 2024

@TimothyMeadows I'm also using the latest NuGet package and I can confirm that something went wrong. g-recaptcha-response is also empty. It worked correctly some time ago. All configuration entries are okay, serviceCollection.AddRecaptcha(...) method call exists. In razor view: @(Html.Recaptcha(recaptchaSettings?.Value))

from recaptcha.aspnetcore.

daver77 avatar daver77 commented on June 2, 2024

@TimothyMeadows

The solution above needs moving to the homepage so others aren't wasting time over this.

from recaptcha.aspnetcore.

TimothyMeadows avatar TimothyMeadows commented on June 2, 2024

This is likely to not occur, i can't document every special use case in the README. However, this can be linked to for future users that might run into the issue. IsAsync exists for a reason.

from recaptcha.aspnetcore.

daver77 avatar daver77 commented on June 2, 2024

This is likely to not occur, i can't document every special use case in the README. However, this can be linked to for future users that might run into the issue. IsAsync exists for a reason.

My page is a bog standard MVC Razor page, not exactly a special case

from recaptcha.aspnetcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.