dhlparcel / dhl-api-wrapper

DHL API Wrapper for PHP
https://www.dhlparcel.com/
MIT License
8 stars 6 forks source link

Access token and Refresh token not being cached #10

Open PetervdPerk opened 5 years ago

PetervdPerk commented 5 years ago

The authentication token does not get cached therefore each new session requires a new authentication. I'm not sure whether the API Gateway of DHL parcel has a limit of authentications per hour, but I suppose sending a lot of new authentication requests is not a feasible solution.

AuthMiddleware.php uses undefined variables called $accessTokenCache and $refreshTokenCache. I suppose we can just cache both the access and refresh tokens and recreate them when they're expired.

Any reason why these prototypes exist yet the caching implementation is not there? Is there more to it? Is it unstable?