AuthController class

Orchestrates login/logout and session persistence between the OmnyShellService and the SettingsStore, exposing an observable AuthSnapshot for the UI.

Constructors

AuthController(OmnyShellService _service, SettingsStore _settings)
Creates a controller.

Properties

hashCode int
The hash code for this object.
no setterinherited
prefill → ({String hub, String principal, String token})
Prefill values for the login form (last Hub + principal, and the remembered token when one is stored — enabling one-click reconnect).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot AuthSnapshot
The current snapshot.
no setter
state Observable<AuthSnapshot>
Observable auth state.
final

Methods

login({required String hub, required String principal, required String token, required bool remember}) Future<void>
Connects to hub as principal using token. When remember is set the token is persisted for the next reload; otherwise it is kept in memory only. Updates state to reflect connecting → connected/error.
logout() Future<void>
Disconnects, forgets the persisted token for the active Hub, and returns to signed-out. The Hub URL and principal are kept to prefill the next login.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tryRestore() Future<bool>
Attempts to restore a prior session from storage on startup. Returns true when a remembered token existed and the reconnect succeeded.

Operators

operator ==(Object other) bool
The equality operator.
inherited