Git Product home page Git Product logo

laravel-recaptchav3's Issues

Content Security Policy Nonce

My server has Content Security Policy enabled, i want to initialize js code with a nonce to allow recaptcha script execution.

Google docs recommend use nonce: FAQ

Can be added a function called initJsNonce() or related?

    /**
     * @param string $nonce
     * @return string
     */
    public function initJsNonce(string $nonce): string
    {
        return '<script src="' . $this->origin . '/api.js?render=' . $this->sitekey . '" nonce="'.$nonce.'"></script>';
    }

As workaround how can add/override RecaptchaV3 class to add this?

I'm not familiarized with Laravel Container to do that, if anyone can help me I would appreciate.

Enhancement : Hide badge

First of all, thanks for sharing this !

A good enhancement would be to hide the badge, and optionnally, show it when the users starts filling a protected form.

Add error message

Is it possible to add an error message if the score is lower then required?
with use of the validator?

Update dependency

Hi Josias,
I pareciate your time to develop this package.
But now I'm trying to update guzzle on my own way and composer response:

josiasmontag/laravel-recaptchav3 0.3.0 requires guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (7.0)

It is possible for you update guzzle?
Thx

Sometimes no score is submitted

Sometimes i see forms being submitted with no score that are not spam.
At the moment i receive my "failed" forms and add the score to check it.
$recaptcha_score = RecaptchaV3::verify($request->get('g-recaptcha-response'), 'contact_general');
Resulting in $recaptcha_score being empty (with Validator using 'g-recaptcha-response' => 'required').

Localization of the widget

Hi,

As I noticed, there is no support for localization, in order to show the widget in different languages depending on the application and the user's needs.

Thanks

Add suport for Guzzle 7

Hi, please add support for the latest version of guzzlehttp/guzzle 7.0.1. I have Laravel 7 and PHP 7.3.21
I have this error in composer.

Using version ^0.5.0 for josiasmontag/laravel-recaptchav3
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for josiasmontag/laravel-recaptchav3 ^0.5.0 -> satisfiable by josiasmontag/laravel-recaptchav3[0.5.0].
- Conclusion: remove guzzlehttp/guzzle 7.0.1
- Conclusion: don't install guzzlehttp/guzzle 7.0.1
- josiasmontag/laravel-recaptchav3 0.5.0 requires guzzlehttp/guzzle ^6.2 -> satisfiable by guzzlehttp/guzzle[6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.3.0, 6.3.1, 6.3.2, 6.3.3, 6.4.0, 6.4.1, 6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.5.4, 6.5.5].
- Can only install one of: guzzlehttp/guzzle[6.2.0, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.2.1, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.2.2, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.2.3, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.3.0, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.3.1, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.3.2, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.3.3, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.4.0, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.4.1, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.0, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.1, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.2, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.3, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.4, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.5, 7.0.1].
- Installation request for guzzlehttp/guzzle (locked at 7.0.1) -> satisfiable by guzzlehttp/guzzle[7.0.1].

Installation failed, reverting ./composer.json to its original content.

error message

hi,

how do i change the error message? it outputs this validation.recaptchav3
sorry, new to laravel.

Score returns null recently

Recently, after working fine for some time, the score returns null or simply the validation fails.

Ran some tests:
Locally score is detected fine, but validation fails anyway.
on Production, score is null and validation fails anyway.

Anyone else experiencing this?

Thanks.

verify method returns false

use Lunaweb\RecaptchaV3\Facades\RecaptchaV3;
// RecaptchaV3::verify($token, $action)
$score = RecaptchaV3::verify($request->get('g-recaptcha-response'), 'register')
if($score > 0.7) {
// go
} elseif($score > 0.3) {
// require additional email verification
} else {
return abort(400, 'You are most likely a bot');
}

above code always returns false

Defer the loading recaptcha__en.js

Hello,
I really like this package. I had no problems setting it up and using it. But lately, the download of the recaptcha__en.js script from www.gstatic.com is the slowest resource that affects my site speed the most. Is it possible to defer the loading of this script?
Best Regards.

Config file publishing

Hello, I'm starting with this and the config file publishing is not working.

The documentation says:

php artisan vendor:publish --provider="Lunaweb\RecaptchaV3\RecaptchaV3ServiceProvider"

but I only was able to publish it doing:

php artisan vendor:publish --provider="Lunaweb\RecaptchaV3\Providers\RecaptchaV3ServiceProvider"

Maybe the namespace is wrong or just the docs.

make RECAPTCHA_ORIGIN configurable

For Chinese visitors/sites, they don't have abilities to access www.google.com for GFW reasons, but they can access recaptcha's domain www.recaptcha.net

eg

so, can you make captcha origin configurable?

const VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';

return '<script src="https://www.google.com/recaptcha/api.js?render=' . $this->sitekey . '"></script>';

Feature request

Hi,

sometimes the page on my website loads slow, so some people push the button to submit to early, so they dont got an google token and the post fail, is it an option to make an callback function so, when it is loaded an callback will be fired, so i can enable the button?

Invalid action name

No matter what i do i always get:
Invalid action name, may only include "A-Za-z/_". Do not include user-specific information. And the form cannot be submitted.

It's rendered like this in the html

  grecaptcha.ready(function() {
      grecaptcha.execute('6LdC4jklAAAAAP7JF31jlY3AjXFEGtCxJxHZRjGf', {action: 'handle-form'}).then(function(token) {
         document.getElementById('g-recaptcha-response-64234447bb0d9').value = token;
      });
  });

Any idea what's going wrong?

reCAPTCHA will timeout

If you are on the page for too long, when you submit the form, there will be a timeout and the reCAPTCHA will not validate. Perhaps, adding a built in function that only sets the token when the form is submitted would solve the issue?

Field g-recaptcha-response is required

I've installed the package following documentation.
The recaptcha logo appears at the bottom of the page, but when I'm going to submit the form, it shows me

Field g-recaptcha-response is required

Also in the console appears this:

contact:280 Uncaught ReferenceError: grecaptcha is not defined
    at contact:280

Error with Ajax

Every time a request is sent using ajax, and there is an error, just let it do it once, you have to reload the page to be able to use it again, because it returns the catpcha error. It should have a function to refresh the captcha.
I made a login where it returns if the person has active, double authentication, so if it returns yes, it should ask for the code on the same page, but it doesn't stop because if it sends the code at once, it should refresh.

Proxy Support

How to use and set up with proxy needed? It's not have proxy set up option?

Bug : validateRecaptchav3 does not exist

Here is an error I get when submitting a form

Method Illuminate\Validation\Validator::validateRecaptchav3 does not exist

After some debugging, it seems the extend('recaptchav3' of the provider is not called before the validation.

The only solution was to move the extend code to my AppServiceProvider::boot...

Note that I add the provider to my config/app.php :

\Lunaweb\RecaptchaV3\Providers\RecaptchaV3ServiceProvider::class,

and that I ran a config:clear and a cache:clear.
If I add a die in the RecaptchaV3ServiceProvider, it got executed when I load a page, but not when I post a form (the error above occurs before it can).

I'm new to laravel, so it's probably a mistake of mine, right ?

Class 'App\Http\Controllers\Validator' not found

I'm new, and I don't know how to import this class to use Validator and RecaptchaV3.
Can you help me please.

Error:
Symfony\Component\Debug\Exception\FatalThrowableError
Class 'App\Http\Controllers\Validator' not found

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.