Open hikalkan opened 5 years ago
Hi. I think the project is die.
if any new reCaptcha library that supports .Core 3.0 comes up please notify me !
Hi, seems like there's simply some kind of change in the way that views are rendered in development. In production - the library is working as intended (though i have "CompileOnPublish" deactivated by default for another reason).
If you want to continue using it - and don't mind missing the feature during development - you can easily create a custom attribute, that ignores captcha-validation for the Development-Environment: using System; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using PaulMiami.AspNetCore.Mvc.Recaptcha;
namespace FluiTec.AppFx.WildServer.Attributes { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class ValidateRecaptchaAttributeIgnoreDevelopment : Attribute, IFilterFactory, IOrderedFilter { public bool IsReusable => true;
public int Order { get; set; }
public IFilterMetadata CreateInstance(IServiceProvider serviceProvider)
{
var environment = serviceProvider.GetRequiredService<IWebHostEnvironment>();
if (!environment.IsDevelopment())
return serviceProvider.GetRequiredService<ValidateRecaptchaFilter>();
return new DontValidateRecaptchaFilter();
}
}
public class DontValidateRecaptchaFilter : IFilterMetadata
{
}
}
I have published a new version compatible with aspnet core 3.1, Let me know if you find any issues with it
Hi,
Any work to support ASP.NET Core 3.0?
Thanks.