/// <summary> /// Specifies that reCAPTCHA token should be passed in http header. /// </summary> /// <param name="builder"></param> /// <param name="configuration"></param> /// <returns></returns> public static IRecaptchaBuilder AddTokenHeaderProvider(this IRecaptchaBuilder builder, IConfiguration configuration) { if (builder is null) { throw new ArgumentNullException(nameof(builder)); } if (configuration is null) { throw new ArgumentNullException(nameof(configuration)); } builder.Services.Configure <RecaptchaTokenHeaderProvider.Options>(configuration); return(builder.AddTokenHeaderProviderInner()); }
/// <summary> /// Specifies that reCAPTCHA token should be passed in http header. /// </summary> /// <param name="builder"></param> /// <param name="setupOptions"></param> /// <returns></returns> public static IRecaptchaBuilder AddTokenHeaderProvider(this IRecaptchaBuilder builder, Action <RecaptchaTokenHeaderProvider.Options> setupOptions = null) { if (builder is null) { throw new ArgumentNullException(nameof(builder)); } if (setupOptions is null) { setupOptions = _ => { }; } builder.Services.Configure(setupOptions); return(builder.AddTokenHeaderProviderInner()); }