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]);
    }
  }
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]);
    }
  }
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 ] ) ; } }
Handle an authentication from a client.

@param ConnectionInterface $from
@param array $data
Handle an authentication from a client .