initial commit from an older template

This commit is contained in:
2025-09-20 22:33:35 +03:00
commit b6778046c2
134 changed files with 6657 additions and 0 deletions

25
Models/Database/RefreshToken.cs Executable file
View File

@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.Database;
public class RefreshToken
{
[Key]
public long Id { get; set; }
public long UserId { get; set; }
public ApplicationUser User { get; set; } = null!;
[Required]
public string Token { get; set; } = null!;
public DateTime Expires { get; set; }
public DateTime Created { get; set; }
public bool IsExpired => DateTime.UtcNow >= Expires;
public bool IsRevoked { get; set; }
public string? RevokedByIp { get; set; }
public DateTime? RevokedOn { get; set; }
public bool IsActive => !IsRevoked && !IsExpired;
}