title: Refresh token must be passed in or set as part of setAccessToken Youtube API
body: <p>I have the following code</p>
  
  <pre><code>if (file_exists($credentialsPath)) {
  
      $accessToken = file_get_contents($credentialsPath);
  
      $client-&gt;setAccessToken($accessToken);
  
      if ($client-&gt;isAccessTokenExpired()) {
          $client-&gt;fetchAccessTokenWithRefreshToken($client-&gt;getRefreshToken());
          $newAccessToken = $client-&gt;getAccessToken();
          $accessToken = array_merge($accessToken, $newAccessToken);
          file_put_contents($credentialsPath, json_encode($accessToken));
      }
  } 
  </code></pre>
  
  <p>But after an hour, if I try to use Youtube Data API, I am getting the following error,</p>
  
  <pre><code>Fatal error: Uncaught exception 'LogicException' with message 'refresh token must be passed in or set as part of setAccessToken' in /var/sentora/hostdata/zadmin/public_html/classes/library/youtube/vendor/google/apiclient/src/Google/Client.php:267 Stack trace: #0 /var/sentora/hostdata/zadmin/public_html/classes/library/youtube/youtube.php(26): Google_Client-&gt;fetchAccessTokenWithRefreshToken(NULL) #1 /var/sentora/hostdata/zadmin/public_html/channel/apiwrap.php(3): require_once('/var/sentora/ho...') #2 {main} thrown in /var/sentora/hostdata/zadmin/public_html/classes/library/youtube/vendor/google/apiclient/src/Google/Client.php on line 267
  </code></pre>
  
  <p>Please help.</p>