Function Signature
Description
A broadcast stream onPortal that emits when the backend rejects the Client Auth session Portal was initialized with: a 401 on a request that carried the session token, or an MPC operation whose authentication failed. The user has to sign in again.
- It emits at most once per session. Afterwards,
Portalcalls fail withSESSION_INVALIDATEDuntilinitialize(session:)runs with a new session. - It is not emitted by
clearSession, and never for aPortalinitialized with an API key. Portal()is a singleton, so the stream carries acrossinitializecalls. Subscribe once, before the firstinitialize(session:). A broadcast stream does not replay, so a listener added after the event never sees it.
clearPersistedSession in response: it deletes whatever is stored, including that newer session. Still handle errors from the call that failed: the stream tells you the session ended, not which operation failed.
Available starting from portal_flutter 2.0.0.
Parameters
This property takes no parameters.Returns
Stream<void> - Emits once when the session is invalidated.