PasswordHasher added
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace TimetableDesigner.Backend.Services.Authentication.Application.Helpers;
|
||||||
|
|
||||||
|
public interface IPasswordHasher
|
||||||
|
{
|
||||||
|
PasswordHashData CreateHash(string password);
|
||||||
|
byte[] ComputeHash(string password, string salt);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace TimetableDesigner.Backend.Services.Authentication.Application.Helpers;
|
||||||
|
|
||||||
|
public record PasswordHashData(
|
||||||
|
byte[] Hash,
|
||||||
|
string LeftSalt,
|
||||||
|
string RightSalt
|
||||||
|
);
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace TimetableDesigner.Backend.Services.Authentication.Application.Helpers;
|
||||||
|
|
||||||
|
public class PasswordHasher
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user