private function autoRenewAuthToken(ApiResponse $response, $header = 'X-Auth-Token')
    {
        $headers = $response->getHeaders();
        if(!empty($headers[$header])) {
            $this->setAuthToken($headers[$header]);
        }
    }
private function autoRenewAuthToken(ApiResponse $response, $header = 'X-Auth-Token')
    {
        $headers = $response->getHeaders();
        if(!empty($headers[$header])) {
            $this->setAuthToken($headers[$header]);
        }
    }
private function autoRenewAuthToken ( ApiResponse $ response , $ header = 'X-Auth-Token' ) { $ headers = $ response -> getHeaders ( ) ; if ( ! empty ( $ headers [ $ header ] ) ) { $ this -> setAuthToken ( $ headers [ $ header ] ) ; } }
Sets freshly generated token if previous token expired
The new token comes from server's response - server automatically checks if the date of current token is approaching expiration
@param ApiResponse $response
@param string $header
@throws \Monetivo\Exceptions\MonetivoException
Sets freshly generated token if previous token expired The new token comes from server s response - server automatically checks if the date of current token is approaching expiration