diff --git a/src/Infrastructure/BotSharp.Abstraction/Users/IUserIdentity.cs b/src/Infrastructure/BotSharp.Abstraction/Users/IUserIdentity.cs index 4fecb48c..4d32d241 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Users/IUserIdentity.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Users/IUserIdentity.cs @@ -9,4 +9,5 @@ public interface IUserIdentity string LastName { get; } string FullName { get; } string? UserLanguage { get; } + string? Phone { get; } } diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs index a8eaac5e..ee3b5c75 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserIdentity.cs @@ -40,7 +40,7 @@ public class UserIdentity : IUserIdentity } [JsonPropertyName("last_name")] - public string LastName + public string LastName => _claims?.FirstOrDefault(x => x.Type == ClaimTypes.Surname)?.Value!; [JsonPropertyName("full_name")] @@ -66,4 +66,7 @@ public class UserIdentity : IUserIdentity return languages.FirstOrDefault(); } } + + [JsonPropertyName("phone")] + public string? Phone => _claims?.FirstOrDefault(x => x.Type == "phone")?.Value; }