@pmate/account-sdk
v0.10.2
Published
New documents in the same origin can restore a server-issued Session from localStorage instead of repeating `/session`. The cache is scoped to the App and exact token, expires 30 seconds before the server expiry, and is only a UI bootstrap hint; API autho
Readme
Shared Session restoration
New documents in the same origin can restore a server-issued Session from localStorage instead of repeating /session. The cache is scoped to the App and exact token, expires 30 seconds before the server expiry, and is only a UI bootstrap hint; API authorization remains server-side. Missing or unavailable storage falls back to the existing network path.
AccountService.session(app, token?) consults this cache. getCachedSession(app, token?) reads it without making a request. clearSessionCache(app?) invalidates both memory and persisted Session entries, including in-flight cache writes. Logout and observed authentication failures invalidate the cache. AccountManager reuses cached profiles only when the restored Session belongs to that same account. Token rotation cannot reuse a previous token's Session. No automatic token refresh protocol is introduced.
