private function handleAuthentication(ConnectionInterface $from, $data) {
    // Save the user's auth token in session storage.
    $token = $data['token'];
    if (isset($token)) {
      $this->sessions[$from] = $token;
    } elseif ($this->sessions->contains($from)) {
      unset($this->sessions[$from]);
    }
  }