Add User Phone Attribute

This commit is contained in:
AnonymousDotNet 2024-08-06 18:50:40 +08:00
parent 79fa124fa1
commit ae1faaf2f4
2 changed files with 5 additions and 1 deletions

View file

@ -9,4 +9,5 @@ public interface IUserIdentity
string LastName { get; }
string FullName { get; }
string? UserLanguage { get; }
string? Phone { get; }
}

View file

@ -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;
}