Files
decePubClient/Models/AuthData.cs
T

24 lines
1.2 KiB
C#
Raw Permalink Normal View History

2022-02-14 01:51:37 +01:00
namespace decePubClient.Models
{
/// <summary>
/// The signed-in session, kept in localStorage: the root's /clientapi JWT and, per persona the client used, the
/// Mastodon token PrivaPub issued for it in exchange (one token per persona, never naming the root).
/// </summary>
2022-02-14 01:51:37 +01:00
public class AuthData
{
/// <summary>The root's JWT, for /clientapi and for exchanging persona tokens.</summary>
2022-02-14 01:51:37 +01:00
public string Token { get; set; }
/// <summary>When the JWT expires, in .NET ticks (JwtUser.Expiration).</summary>
2022-02-14 01:51:37 +01:00
public long? TokenExpiration { get; set; }
/// <summary>When the client received the JWT, in .NET ticks: with TokenExpiration, how long PrivaPub's tokens last.</summary>
public long? TokenIssuedAt { get; set; }
2022-02-14 01:51:37 +01:00
public string CurrentLanguageCode { get; set; } = "en";
/// <summary>The root's login name; shown only to its owner.</summary>
public string UserName { get; set; }
public List<string> Policies { get; set; } = [];
/// <summary>The avatar id of the persona the client acts as.</summary>
public string PersonaId { get; set; }
/// <summary>Avatar id → that persona's Mastodon access token.</summary>
public Dictionary<string, string> PersonaTokens { get; set; } = [];
2022-02-14 01:51:37 +01:00
}
}