revokeToken method

void revokeToken(
  1. String token
)

Makes token invalid, as revoking a key does on a real server: every open connection bound to it loses its subscriptions (closed for each) and its session (authed with rejected, unasked).

Implementation

void revokeToken(String token) {
  _tokens.remove(token);
  for (final connection in openConnections.toList()) {
    if (connection.token != token) continue;
    _bind(connection, null, null);
    connection.send(const DwAuthenticatedMessage.rejected());
  }
}