* Extended functionalities
* Added different UIs
This commit is contained in:
26
MealPlan.Api/Models/RefreshTokenEntity.cs
Normal file
26
MealPlan.Api/Models/RefreshTokenEntity.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace MealPlan.Api.Models;
|
||||
|
||||
[Table("RefreshTokens")]
|
||||
public class RefreshTokenEntity
|
||||
{
|
||||
[Column("Token")]
|
||||
public string Token { get; set; } = string.Empty;
|
||||
|
||||
[Column("UserId")]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
[Column("ExpiresAtUtc")]
|
||||
public DateTime ExpiresAtUtc { get; set; }
|
||||
|
||||
[Column("CreatedAtUtc")]
|
||||
public DateTime CreatedAtUtc { get; set; }
|
||||
|
||||
[Column("IsRevoked")]
|
||||
public bool IsRevoked { get; set; }
|
||||
|
||||
public bool IsActive => !IsRevoked && DateTime.UtcNow < ExpiresAtUtc;
|
||||
|
||||
public ApplicationUser? User { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user