TimothyMeadows / reCAPTCHA.AspNetCore

Google reCAPTCHA v2/v3 for .NET Core 3.x
MIT License
144 stars 51 forks source link

Cache result #89

Closed NathanJPhillips closed 3 years ago

NathanJPhillips commented 3 years ago

Allow to access result of Validate

Cache the result of Validate in the HttpContext for the current request. This prevents the need for another request to the provider when one needs to access the score after using an attribute to check it already. This could allow a controller action that validates the score is at least 0.5 but then also saves that score into a database or attaches it to an email.

TimothyMeadows commented 3 years ago

I can't agree with this being part of the main package, however feel free to add a new package on nuget that extends this package such as "reCAPTCHA.ASpNetCore.Cache" that injects this functionality for yourself or others that wish it.