generation of salt

This commit is contained in:
2025-10-14 09:28:56 +02:00
parent 9c4e1e4f60
commit e8d3b69970
2 changed files with 3 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.20" />
<PackageReference Include="PasswordGenerator" Version="2.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2"/>
</ItemGroup>

View File

@@ -1,5 +1,6 @@
using ApiEfCoreLibrary.DTO.Login.Request;
using ApiEfCoreLibrary.DTO.Login.Response;
using PasswordGenerator;
namespace ApiEfCoreLibrary.Endpoints.Login;
using FastEndpoints;
@@ -14,7 +15,7 @@ public class CreateLoginEndpoint(LibraryDbContext database) : Endpoint<CreateLog
public override async Task HandleAsync(CreateLoginDto req, CancellationToken ct)
{
string? salt = BCrypt.Net.BCrypt.GenerateSalt(24);
string? salt = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().LengthRequired(24).Next();
var login = new Models.Login()
{