question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReCAPTCHA settings null after using AddRecaptcha options

See original GitHub issue

Hi…

Your fix for #60 has worked so far as it stops the application from crashing on runtime, however it seems the settings set using the options method do not persist when they are injected into a controller…

Read me example being used:

// Or configure recaptcha via options
services.AddRecaptcha(options =>
{
    options.SecretKey = "Your secret key";
    options.SiteKey = "Your site key";
});

image

I noticed this issue when trying to validate responses. The Validate(code) method was returning a new response object with all fields set to the default value. It may be worth throwing some sort of exception if a validation is attempted without a secret key…

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TimothyMeadowscommented, Jun 25, 2020

This is now fixed in 3.0.5.

0reactions
mo-esmpcommented, Jun 27, 2020

Yes, I removed IOptions but you rolled back code to IOptions. I added some integration tests to validate captcha registration and I think it worth to run tests after any change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Null in g-recaptcha-response Google's reCaptcha
I've run into the same issue. The strangest part is a client-side call to grecaptcha.getResponse() returns to correct response.
Read more >
Troubleshooting | reCAPTCHA
I Can't Work Out Where to Add reCAPTCHA; It's Not Working! Help! reCAPTCHA is Accepting Incorrect Words; No, I Mean *Totally* Incorrect ...
Read more >
Processing Google reCaptcha Tokens in ASP.NET Core
The important part is that some client side code will help us to generate a token through the reCaptcha service using a client...
Read more >
Settings | reCAPTCHA
The Admin Console allows you to view your reCAPTCHA site key and secret key, and configure the settings of your reCAPTCHA keys at...
Read more >
Google ReCaptcha v3 & Contact Form 7 Not Working
In my console there was an error with the plugin: “Autoptimize”. After deactivating some js-settings it works again. hansbeen. (@hansbeen). 4 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found