namespace Elfisa.Core;

/// <summary>Текущая сессия пользователя (токен, роль, логин).</summary>
public sealed class Session
{
    public static Session Current { get; } = new();

    public string? Token { get; set; }
    public string? Role { get; set; }
    public string? Username { get; set; }

    public bool IsAuthenticated => !string.IsNullOrWhiteSpace(Token);

    public void Clear()
    {
        Token = null;
        Role = null;
        Username = null;
    }
}
