I have a scenario where I needed to loop through all the stored tokens and retrieve some user data with them. The current cache implementation doesn't take the access token into account meaning that if you're calling the same endpoint (identity in my case) but with different access tokens, you will get the same data every time.
Current code:
// Construct request:
$api_request = $this->api_endpoint . $suffix;
// This identifies a unique request
$api_request_hash = md5($api_request);
Suggessted fix:
// Construct request:
$api_request = $this->api_endpoint . $suffix;
// This identifies a unique request
$api_request_hash = md5($api_request . $this->access_token);
If anyone is running into this issue you can empty the cache before making your request as a quick fix.
$client = new API($token); //Create client
API::$request_cache = null; //Empty the cache
$response = $client->get_data("identity"); //Make the request
I have a scenario where I needed to loop through all the stored tokens and retrieve some user data with them. The current cache implementation doesn't take the access token into account meaning that if you're calling the same endpoint (
identity
in my case) but with different access tokens, you will get the same data every time.Current code:
Suggessted fix:
If anyone is running into this issue you can empty the cache before making your request as a quick fix.