public function authenticate(ClientContract $client): void
    {
        if ($this->cookie !== '' || $this->isAuthenticating) {
            return;
        }

        $this->isAuthenticating = true;
        $response = $client->request('POST', '/user/login', [
            'login' => $this->username,
            'password' => $this->password,
        ]);
        $this->isAuthenticating = false;

        if ($response->isStatusCode(200)) {
            $this->cookie = $response->cookie();
        }
    }
public function authenticate(ClientContract $client): void
    {
        if ($this->cookie !== '' || $this->isAuthenticating) {
            return;
        }

        $this->isAuthenticating = true;
        $response = $client->request('POST', '/user/login', [
            'login' => $this->username,
            'password' => $this->password,
        ]);
        $this->isAuthenticating = false;

        if ($response->isStatusCode(200)) {
            $this->cookie = $response->cookie();
        }
    }
public function authenticate ( ClientContract $ client ) : void { if ( $ this -> cookie !== '' || $ this -> isAuthenticating ) { return ; } $ this -> isAuthenticating = true ; $ response = $ client -> request ( 'POST' , '/user/login' , [ 'login' => $ this -> username , 'password' => $ this -> password , ] ) ; $ this -> isAuthenticating = false ; if ( $ response -> isStatusCode ( 200 ) ) { $ this -> cookie = $ response -> cookie ( ) ; } }
Authenticate client and returns cookie on success login.

@param \Cog\Contracts\YouTrack\Rest\Client\Client $client
@return void

@throws \Cog\Contracts\YouTrack\Rest\Authenticator\Exceptions\AuthenticationException
Authenticate client and returns cookie on success login .