diff --git a/Falcon.SugarApi/FalconClaim/IServiceCollectionExtend.cs b/Falcon.SugarApi/FalconClaim/IServiceCollectionExtend.cs index 12472c0..3d3d75b 100644 --- a/Falcon.SugarApi/FalconClaim/IServiceCollectionExtend.cs +++ b/Falcon.SugarApi/FalconClaim/IServiceCollectionExtend.cs @@ -3,7 +3,6 @@ using Falcon.SugarApi.JsonSerialize; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using System; -using System.Text.Json; namespace Falcon.SugarApi.FalconClaim { @@ -13,19 +12,20 @@ namespace Falcon.SugarApi.FalconClaim public static class IServiceCollectionExtend { /// - /// 增加FalconCalom相关服务 + /// 增加FalconClaim相关服务 /// - public static IServiceCollection AddFalconClaim(this IServiceCollection services,Action? optionBuilder = null) { - optionBuilder?.Invoke(new FalconClaimOption()); + public static IServiceCollection AddFalconClaim(this IServiceCollection services, Action? optionBuilder = null) { + var option = new FalconClaimOption(); + optionBuilder?.Invoke(option); services.TryAddSingleton(); - services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); - services.TryAddSingleton(); + services.TryAddSingleton(); services.AddAuthentication(b => { b.DefaultAuthenticateScheme = FalconClaimOption.SchemeName; b.DefaultChallengeScheme = FalconClaimOption.SchemeName; b.DefaultForbidScheme = FalconClaimOption.SchemeName; - b.AddScheme(FalconClaimOption.SchemeName,FalconClaimOption.SchemeName); + b.AddScheme(FalconClaimOption.SchemeName, FalconClaimOption.SchemeName); }); return services; }