diff --git a/Directory.Packages.props b/Directory.Packages.props index 666d4c7abf5..bd9e1fabdaf 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,14 +12,14 @@ - + - - + + @@ -38,18 +38,18 @@ - + - + @@ -61,7 +61,7 @@ - + @@ -81,9 +81,9 @@ - - - + + + diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AccountController.cs b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AccountController.cs index 4b2f714f74e..6dcf4adf19d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AccountController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AccountController.cs @@ -15,7 +15,6 @@ using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Microsoft.IdentityModel.Tokens; using OrchardCore.ContentManagement; using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.ModelBinding; @@ -29,6 +28,7 @@ using OrchardCore.Users.Models; using OrchardCore.Users.Services; using OrchardCore.Users.ViewModels; +using YesSql.Services; using SignInResult = Microsoft.AspNetCore.Identity.SignInResult; namespace OrchardCore.Users.Controllers @@ -810,13 +810,13 @@ public static async Task UpdateUserPropertiesAsync(UserManager user userNeedUpdate = !JsonNode.DeepEquals(currentProperties, user.Properties); } - var currentClaims = user.UserClaims. - Where(x => !x.ClaimType.IsNullOrEmpty()). - DistinctBy(x => new { x.ClaimType, x.ClaimValue }). - ToList(); + var currentClaims = user.UserClaims + .Where(x => !string.IsNullOrEmpty(x.ClaimType)) + .DistinctBy(x => new { x.ClaimType, x.ClaimValue }) + .ToList(); var claimsChanged = false; - if (context.ClaimsToRemove != null) + if (context.ClaimsToRemove?.Count > 0) { var claimsToRemove = context.ClaimsToRemove.ToHashSet(); foreach (var item in claimsToRemove) @@ -830,7 +830,7 @@ public static async Task UpdateUserPropertiesAsync(UserManager user } } - if (context.ClaimsToUpdate != null) + if (context.ClaimsToUpdate?.Count > 0) { foreach (var item in context.ClaimsToUpdate) {