From 17d5c1e2f1030495105461a059dadc230c4d42a0 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 6 Jul 2023 15:11:52 +0800 Subject: [PATCH] Enable nullable annotations for Volo.Abp.AspNetCore.Authentication.OAuth --- .../Volo.Abp.AspNetCore.Authentication.OAuth.csproj | 2 ++ .../Authentication/OAuth/Claims/MultipleClaimAction.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj index 562e559273..f8efe3c11c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj @@ -5,6 +5,8 @@ net7.0 + enable + Nullable Volo.Abp.AspNetCore.Authentication.OAuth Volo.Abp.AspNetCore.Authentication.OAuth $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs index 1910af63d5..e058303572 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs @@ -29,7 +29,7 @@ public class MultipleClaimAction : ClaimAction switch (prop.ValueKind) { case JsonValueKind.String: - claim = new Claim(ClaimType, prop.GetString(), ValueType, issuer); + claim = new Claim(ClaimType, prop.GetString()!, ValueType, issuer); if (!identity.Claims.Any(c => c.Type == claim.Type && c.Value == claim.Value)) { identity.AddClaim(claim); @@ -38,7 +38,7 @@ public class MultipleClaimAction : ClaimAction case JsonValueKind.Array: foreach (var arramItem in prop.EnumerateArray()) { - claim = new Claim(ClaimType, arramItem.GetString(), ValueType, issuer); + claim = new Claim(ClaimType, arramItem.GetString()!, ValueType, issuer); if (!identity.Claims.Any(c => c.Type == claim.Type && c.Value == claim.Value)) { identity.AddClaim(claim);