Path: redb/redb.Templates/templates/redb-app/RedbApp.Web/Services/Session.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/redb-app/RedbApp.Web/Services/Session.cs ---- using RedbApp.Models; namespace RedbApp.Web.Services; /// /// Who is signed in, and the token that proves it. Kept in memory only: reloading the page signs out. /// A real application may keep the token in sessionStorage through JS interop. /// public sealed class Session { public string? Token { get; private set; } public string? Login { get; private set; } public string? Role { get; private set; } public bool IsSignedIn => Token is not null; public event Action? Changed; public void SignIn(LoginResponse response) { Token = response.Token; Login = response.Login; Role = response.Role; Changed?.Invoke(); } public void SignOut() { Token = Login = Role = null; Changed?.Invoke(); } }