SessionStore

class SessionStore(val siteId: String, secure: KeyValueStore, prefs: KeyValueStore)

Persists a StoredSession under hatang_chat.<siteId>.*: the token in the secure store, everything else in the prefs store.

Constructors

Link copied to clipboard
constructor(siteId: String, secure: KeyValueStore, prefs: KeyValueStore)

Properties

Link copied to clipboard

The install id store (prefs).

Link copied to clipboard

The site.

Link copied to clipboard

The token's key (secure storage).

Functions

Link copied to clipboard
suspend fun load(): StoredSession

Loads everything. A secure store that fails reads as "no token".

Link copied to clipboard
suspend fun save(s: StoredSession)

Writes every field of s (nulls delete).