SessionController class final
Owns the token lifecycle for one Logto session (C0 §12): access = 10 minutes, refresh = 14 days rotating with reuse detection, and a silent re-mint on every app open. Lifetimes are ENFORCED, not trusted: a provider that hands back a longer-lived token is rejected.
- Inheritance
-
- Object
- ChangeNotifier
- SessionController
Constructors
- SessionController({required AuthProvider provider, Duration accessLifetime = TokenLifetimes.access, Duration refreshLifetime = TokenLifetimes.refresh, DateTime now()?})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- problem → Problem?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → SessionStatus
-
no setter
- tokens → SessionTokens?
-
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onAppOpen(
) → Future< Result< SessionTokens> > - Silent re-mint on app open: a fresh session always starts on a fresh access token (C0 §12). The refresh token is preserved.
-
refresh(
) → Future< Result< SessionTokens> > - Rotating refresh with reuse detection. A refresh that changes the family or re-returns the same refresh token signs the session out (theft).
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
signIn(
{Map< String, String> extraParams = const <String, String>{}}) → Future<Result< SessionTokens> > -
Interactive sign-in.
extraParamscarries deferred-login one-time-token / login-hint params when redeeming an app-handoff carrier. -
signOut(
) → Future< void> - Clears local + provider session state.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited