diff --git a/Endpoint/Common/MapperDto/UserConverter.cs b/Endpoint/Common/MapperDto/UserConverter.cs new file mode 100644 index 0000000..920e340 --- /dev/null +++ b/Endpoint/Common/MapperDto/UserConverter.cs @@ -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 + }; +} \ No newline at end of file diff --git a/Endpoint/Controllers/V1/AuthController.cs b/Endpoint/Controllers/V1/AuthController.cs index 93ab423..640c80c 100644 --- a/Endpoint/Controllers/V1/AuthController.cs +++ b/Endpoint/Controllers/V1/AuthController.cs @@ -178,17 +178,7 @@ public class AuthController(IOptionsSnapshot user, IOptionsSnapshot