deleteToken method

Future<bool> deleteToken(
  1. List<String> scopes
)

Implementation

Future<bool> deleteToken(List<String> scopes) async {
  final serTokens = await storage.read(key);

  if (serTokens != null) {
    final scopeKey = getScopeKey(scopes);
    final tokens = Map.from(jsonDecode(serTokens));

    if (tokens.containsKey(scopeKey)) {
      tokens.remove(scopeKey);
      await storage.write(key, jsonEncode(tokens));
    }
  }

  return true;
}