generation of salt
This commit is contained in:
@@ -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>
|
||||
|
||||
|
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user