Initial commit

This commit is contained in:
2026-06-04 06:24:56 +02:00
commit 282f4864c4
111 changed files with 8083 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
namespace MealPlan.Api.Models;
/// <summary>
/// In-memory refresh token record. Stored in a singleton store rather than the database,
/// because the existing schema must not be modified and no migrations may be created.
/// Rotation: every successful refresh invalidates the previous token and issues a new one.
/// </summary>
public class RefreshToken
{
public string Token { get; set; } = string.Empty;
public string UserId { get; set; } = string.Empty;
public DateTime ExpiresAtUtc { get; set; }
public DateTime CreatedAtUtc { get; set; }
public bool IsRevoked { get; set; }
public bool IsActive => !IsRevoked && DateTime.UtcNow < ExpiresAtUtc;
}