feat: add authorize in OAuth
This commit is contained in:
36
Security/Common/Domain/OAuth2/UserInfo/MailRuUserInfo.cs
Normal file
36
Security/Common/Domain/OAuth2/UserInfo/MailRuUserInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Mirea.Api.Security.Common.Interfaces;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Mirea.Api.Security.Common.Domain.OAuth2.UserInfo;
|
||||
|
||||
internal class MailRuUserInfo : IUserInfo
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public required string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("email")]
|
||||
public required string Email { get; set; }
|
||||
|
||||
[JsonPropertyName("first_name")]
|
||||
public required string FirstName { get; set; }
|
||||
|
||||
[JsonPropertyName("last_name")]
|
||||
public required string LastName { get; set; }
|
||||
|
||||
[JsonPropertyName("nickname")]
|
||||
public required string Username { get; set; }
|
||||
|
||||
[JsonPropertyName("image")]
|
||||
public string? Image { get; set; }
|
||||
|
||||
public OAuthUser MapToInternalUser() =>
|
||||
new()
|
||||
{
|
||||
Id = Id,
|
||||
Email = Email,
|
||||
FirstName = FirstName,
|
||||
LastName = LastName,
|
||||
Username = Username,
|
||||
IconUri = Image
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user