getWebId static method

Future<String?> getWebId()

Returns the cached WebID, falling back to secure storage.

Implementation

static Future<String?> getWebId() async {
  if (_webId != null) return _webId;

  final dataStr = await secureStorage.read(key: _authDataSecureStorageKey);
  if (dataStr != null) {
    try {
      final dataMap = jsonDecode(dataStr) as Map<String, dynamic>;
      _webId = dataMap['web_id'] as String?;
    } on Object {
      _webId = null;
    }
  }
  return _webId;
}