auto.bus_api/Server/Entities/RefreshToken.cs

14 lines
393 B
C#

using Microsoft.EntityFrameworkCore;
namespace Server.Entities;
[Owned]
public class RefreshToken
{
public string Token { get; set; } = null!;
public DateTime Expires { get; set; }
public bool IsExpired => DateTime.UtcNow >= Expires;
public DateTime Created { get; set; }
public DateTime? Revoked { get; set; }
public bool IsActive => Revoked == null && !IsExpired;
}