IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

Very short margin on OAuth token refresh #140

Open vicdelfant opened 1 month ago

vicdelfant commented 1 month ago

It seems that an access token is only refreshed if it actually expired already, or will expire within the next 1 second: https://github.com/IsraelOrtuno/pipedrive/blob/cc5fee011ef4e836ce60aa97d2a8a51c9645a633/src/PipedriveToken.php#L125

This seems to be a very short window given that there can easily be a time difference between systems. Is there a specific reason that this was set to such a short timeframe, or would it be okay to submit a PR to change it to a minute? With the access tokens being valid for 1 hour, that's still plenty of margin.