2022-02-14 01:51:37 +01:00
|
|
|
namespace decePubClient.Models
|
|
|
|
|
{
|
2026-10-04 11:03:14 +02:00
|
|
|
/// <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
|
|
|
|
|
{
|
2026-10-04 11:03:14 +02:00
|
|
|
/// <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; }
|
2026-10-04 11:03:14 +02:00
|
|
|
/// <summary>When the JWT expires, in .NET ticks (JwtUser.Expiration).</summary>
|
2022-02-14 01:51:37 +01:00
|
|
|
public long? TokenExpiration { get; set; }
|
2026-10-04 11:03:14 +02:00
|
|
|
/// <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";
|
2026-10-04 11:03:14 +02:00
|
|
|
/// <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
|
|
|
}
|
|
|
|
|
}
|