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); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { CheckGoogleReCaptchaHelper.CheckGoogleReCaptchaAsync(filterContext, _invisible, _requiredScore, _actionName).Wait(); base.OnActionExecuting(filterContext); }