feat: implement token generation and issuing on successful login

This commit is contained in:
Stevan Freeborn
2026-02-03 04:38:40 -06:00
parent 38a03f56ca
commit 36b293aa15
7 changed files with 139 additions and 18 deletions
@@ -2,6 +2,22 @@ namespace FiscalOS.Core.Identity;
public sealed class RefreshToken : Entity
{
public string Token { get; init; } = string.Empty;
public DateTimeOffset ExpiresAt { get; init; }
public Guid UserId { get; init; }
public User User { get; init; } = new();
private RefreshToken()
{
}
public static RefreshToken From(Guid userId, string token, DateTimeOffset expiresAt)
{
return new()
{
UserId = userId,
Token = token,
ExpiresAt = expiresAt,
};
}
}