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);
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: