added support for multiple accounts, guardian login bugfixes, ui changes

This commit is contained in:
2026-09-23 20:50:12 +02:00
parent 630497abdd
commit 84098af7e2
37 changed files with 1759 additions and 376 deletions
@@ -60,6 +60,26 @@ class MarianumConnectTokenStorage {
);
}
static const bearerKey = _tokenKey;
static const fieldKeys = [_tokenKey, _tokenIdKey, _expiresAtKey];
/// Raw stored fields, for parking the token of an inactive account.
Future<Map<String, String>> readAll() async => {
for (final key in fieldKeys) key: ?await _storage.read(key: key),
};
/// Restores fields from [readAll]; missing ones are deleted.
Future<void> writeAll(Map<String, String> fields) async {
for (final key in fieldKeys) {
final value = fields[key];
if (value == null) {
await _storage.delete(key: key);
} else {
await _storage.write(key: key, value: value);
}
}
}
Future<void> clear() async {
await _storage.delete(key: _tokenKey);
await _storage.delete(key: _tokenIdKey);