2026-02-02 04:45:56 -06:00
|
|
|
namespace FiscalOS.Core.Identity;
|
|
|
|
|
|
|
|
|
|
public sealed class RefreshToken : Entity
|
|
|
|
|
{
|
2026-02-02 06:32:14 -06:00
|
|
|
public string Token { get; init; } = string.Empty;
|
|
|
|
|
public DateTimeOffset ExpiresAt { get; init; }
|
2026-02-02 04:45:56 -06:00
|
|
|
public Guid UserId { get; init; }
|
2026-02-03 05:50:41 -06:00
|
|
|
public User User { get; init; } = null!;
|
2026-02-02 06:32:14 -06:00
|
|
|
|
|
|
|
|
private RefreshToken()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static RefreshToken From(Guid userId, string token, DateTimeOffset expiresAt)
|
|
|
|
|
{
|
|
|
|
|
return new()
|
|
|
|
|
{
|
|
|
|
|
UserId = userId,
|
|
|
|
|
Token = token,
|
|
|
|
|
ExpiresAt = expiresAt,
|
|
|
|
|
};
|
|
|
|
|
}
|
2026-02-02 04:45:56 -06:00
|
|
|
}
|