mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Updeted Session Model and Session Opener Service
renamed RefreshToken in model to RefreshTokenHash - now we have a hash of token, not a token
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Govor.Application.Interfaces.Authentication;
|
||||
|
||||
namespace Govor.Application.Services.Authentication;
|
||||
|
||||
public class JwtTokenHasher : IJwtTokenHasher
|
||||
{
|
||||
public string HashToken(string token)
|
||||
{
|
||||
return BCrypt.Net.BCrypt.HashPassword(token, workFactor: 13);
|
||||
}
|
||||
|
||||
public bool VerifyToken(string token, string storedHash)
|
||||
{
|
||||
return BCrypt.Net.BCrypt.Verify(token, storedHash);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user