2
0
forked from Wavyzz/dolibarr

expire was initiated as true instead of false

This commit is contained in:
Faustin
2022-08-12 11:42:23 +02:00
parent 0898a99314
commit 6dd17ead60

View File

@@ -886,7 +886,7 @@ class CMailFile
$storage = new DoliStorage($db, $conf); $storage = new DoliStorage($db, $conf);
try { try {
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
$expire = true; $expire = false;
// Is token expired or will token expire in the next 30 seconds // Is token expired or will token expire in the next 30 seconds
if (is_object($tokenobj)) { if (is_object($tokenobj)) {
$expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30)); $expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30));