Bynder / bynder-php-sdk

SDK in PHP for integration with Bynder
MIT License
13 stars 22 forks source link

Refreshing token is tedious as API response does not contain a new refresh token #29

Open Berdir opened 3 years ago

Berdir commented 3 years ago

While implementing the refresh functionality, I realized that the updated AccessToken object doesn't contain a new access result, and since there is no setter on that, you have to extract the values and re-create it yourself. Would be nice if the API could handle that:

      $options = $this->bynderConfiguration->getToken()->jsonSerialize();
      if (empty($data['refresh_token'])) {
        $options['refresh_token'] = $oldToken->getRefreshToken();
      }

      $newToken = new AccessToken($options);
ConstantBqt commented 1 day ago

I guess we can now close this issue as it’s been fixed