From a9abc96cc83d659cc129bda228fa83793a53d2ac Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Thu, 19 Sep 2024 13:29:42 -0500 Subject: [PATCH] Add user role --- src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs index f9758be6..17673c1a 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs @@ -161,6 +161,7 @@ public class UserService : IUserService ExternalId = user.ExternalId, Password = user.Password, Type = user.Type, + Role = user.Role }; await CreateUser(record); } @@ -215,6 +216,7 @@ public class UserService : IUserService new Claim("source", user.Source), new Claim("external_id", user.ExternalId ?? string.Empty), new Claim("type", user.Type ?? UserType.Client), + new Claim("role", user.Role ?? UserRole.User), new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()), new Claim("phone", user.Phone ?? string.Empty) };