From a16b1e435881a86de0bb8bb9eca7209878bfbf74 Mon Sep 17 00:00:00 2001 From: "jason.wang" Date: Sun, 20 Oct 2024 13:02:13 +0800 Subject: [PATCH] fix issue by self test --- .../BotSharp.Core/Users/Services/UserIdentity.cs | 2 +- .../BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs index 9b7615af..9ee2238b 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs @@ -80,5 +80,5 @@ public class UserIdentity : IUserIdentity public string? Type => _claims?.FirstOrDefault(x => x.Type == "type")?.Value; [JsonPropertyName("role")] - public string? Role => _claims?.FirstOrDefault(x => x.Type == "role")?.Value; + public string? Role => _claims?.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value; } diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs index 8526788b..a3d84e7d 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs @@ -22,7 +22,7 @@ public class UserDocument : MongoBase public string? EmployeeId { get; set; } public bool IsDisabled { get; set; } public DateTime CreatedTime { get; set; } - public DateTime UpdatedTime { get; set; } + public DateTime UpdatedTime { get; set; } public User ToUser() { @@ -41,6 +41,7 @@ public class UserDocument : MongoBase Type = Type, Role = Role, AffiliateId = AffiliateId, + EmployeeId = EmployeeId, IsDisabled = IsDisabled, VerificationCode = VerificationCode, Verified = Verified,