mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-04-06 02:19:05 +00:00
Refactor auth/user services
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace Infrastructure.Jwt;
|
||||
|
||||
public interface IJwtService
|
||||
public interface ITokenInfrastructure
|
||||
{
|
||||
string GenerateJwt(Guid userId, string username, DateTime expiry);
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using JwtRegisteredClaimNames = System.IdentityModel.Tokens.Jwt.JwtRegisteredCla
|
||||
|
||||
namespace Infrastructure.Jwt;
|
||||
|
||||
public class JwtService : IJwtService
|
||||
public class JwtInfrastructure : ITokenInfrastructure
|
||||
{
|
||||
private readonly string? _secret = Environment.GetEnvironmentVariable(
|
||||
"JWT_SECRET"
|
||||
@@ -4,7 +4,7 @@ using Konscious.Security.Cryptography;
|
||||
|
||||
namespace Infrastructure.PasswordHashing;
|
||||
|
||||
public class Argon2Infrastructure : IPasswordInfra
|
||||
public class Argon2Infrastructure : IPasswordInfrastructure
|
||||
{
|
||||
private const int SaltSize = 16; // 128-bit
|
||||
private const int HashSize = 32; // 256-bit
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Infrastructure.PasswordHashing;
|
||||
|
||||
public interface IPasswordInfra
|
||||
public interface IPasswordInfrastructure
|
||||
{
|
||||
public string Hash(string password);
|
||||
public bool Verify(string password, string stored);
|
||||
Reference in New Issue
Block a user