Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASP.NET Core 3.0 support #36

Open
hikalkan opened this issue Sep 25, 2019 · 4 comments
Open

ASP.NET Core 3.0 support #36

hikalkan opened this issue Sep 25, 2019 · 4 comments
Assignees

Comments

@hikalkan
Copy link

Hi,

Any work to support ASP.NET Core 3.0?

Thanks.

@taras-kolodchyn
Copy link

Hi. I think the project is die.

@ebicoglu
Copy link

if any new reCaptcha library that supports .Core 3.0 comes up please notify me !

@IInvocation
Copy link

IInvocation commented Nov 23, 2019

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
{

}

}

@PaulMiami
Copy link
Owner

I have published a new version compatible with aspnet core 3.1, Let me know if you find any issues with it

@PaulMiami PaulMiami self-assigned this Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants