Esempio n. 1
0
        public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context)
        {
            if (HandlerNames.Length == 0)
            {
                return(string.Equals(context.HandlerMethod?.HttpMethod, HttpMethod.Post.Method,
                                     StringComparison.OrdinalIgnoreCase)
                    ? CheckGoogleReCaptchaHelper.CheckGoogleReCaptchaAsync(context, _invisible, _requiredScore, _actionName)
                    : Task.CompletedTask);
            }

            return(HandlerNames.Contains(context.HandlerMethod.Name)
                ? CheckGoogleReCaptchaHelper.CheckGoogleReCaptchaAsync(context, _invisible, _requiredScore, _actionName)
                : Task.CompletedTask);
        }
Esempio n. 2
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     CheckGoogleReCaptchaHelper.CheckGoogleReCaptchaAsync(filterContext, _invisible, _requiredScore, _actionName).Wait();
     base.OnActionExecuting(filterContext);
 }