diff --git a/TimetableDesigner.Backend.Services.Authentication/DTO/Validators/RegisterRequestValidator.cs b/TimetableDesigner.Backend.Services.Authentication/API/Validators/RegisterRequestValidator.cs similarity index 100% rename from TimetableDesigner.Backend.Services.Authentication/DTO/Validators/RegisterRequestValidator.cs rename to TimetableDesigner.Backend.Services.Authentication/API/Validators/RegisterRequestValidator.cs diff --git a/TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterDto.cs b/TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterData.cs similarity index 100% rename from TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterDto.cs rename to TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterData.cs diff --git a/TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterMappers.cs b/TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterMappers.cs new file mode 100644 index 0000000..3317d95 --- /dev/null +++ b/TimetableDesigner.Backend.Services.Authentication/Application/Commands/Register/RegisterMappers.cs @@ -0,0 +1,10 @@ +using TimetableDesigner.Backend.Services.Authentication.Application.Commands.Register; +using TimetableDesigner.Backend.Services.Authentication.DTO.API; + +namespace TimetableDesigner.Backend.Services.Authentication.DTO.Mappers; + +public static class RegisterMappers +{ + public static RegisterCommand ToCommand(this RegisterRequest request) => + new RegisterCommand(request.Email, request.Password); +} \ No newline at end of file diff --git a/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/IPasswordHasher.cs b/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/IPasswordHasher.cs new file mode 100644 index 0000000..36e1119 --- /dev/null +++ b/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/IPasswordHasher.cs @@ -0,0 +1,7 @@ +namespace TimetableDesigner.Backend.Services.Authentication.Application.Helpers; + +public interface IPasswordHasher +{ + PasswordHashData CreateHash(string password); + byte[] ComputeHash(string password, string salt); +} \ No newline at end of file diff --git a/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/PasswordHashData.cs b/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/PasswordHashData.cs new file mode 100644 index 0000000..cb01f57 --- /dev/null +++ b/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/PasswordHashData.cs @@ -0,0 +1,7 @@ +namespace TimetableDesigner.Backend.Services.Authentication.Application.Helpers; + +public record PasswordHashData( + byte[] Hash, + string LeftSalt, + string RightSalt +); \ No newline at end of file diff --git a/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/PasswordHasher.cs b/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/PasswordHasher.cs new file mode 100644 index 0000000..96f7d5c --- /dev/null +++ b/TimetableDesigner.Backend.Services.Authentication/Application/Helpers/PasswordHasher.cs @@ -0,0 +1,6 @@ +namespace TimetableDesigner.Backend.Services.Authentication.Application.Helpers; + +public class PasswordHasher +{ + +} \ No newline at end of file