refactor: add user converter
This commit is contained in:
20
Endpoint/Common/MapperDto/UserConverter.cs
Normal file
20
Endpoint/Common/MapperDto/UserConverter.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using Mirea.Api.Endpoint.Configuration.Model;
|
||||
using Mirea.Api.Security.Common.Model;
|
||||
|
||||
namespace Mirea.Api.Endpoint.Common.MapperDto;
|
||||
|
||||
public static class UserConverter
|
||||
{
|
||||
public static User ConvertToSecurity(this Admin data) =>
|
||||
new()
|
||||
{
|
||||
Id = 1.ToString(),
|
||||
Email = data.Email,
|
||||
Username = data.Username,
|
||||
PasswordHash = data.PasswordHash,
|
||||
Salt = data.Salt,
|
||||
SecondFactorToken = data.Secret,
|
||||
TwoFactorAuthenticator = data.TwoFactorAuthenticator,
|
||||
OAuthProviders = data.OAuthProviders
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user