cleaned up code base thoroughly
This commit is contained in:
@@ -73,7 +73,7 @@ class Esi {
|
|||||||
|
|
||||||
//Create the carbon time for expiration time
|
//Create the carbon time for expiration time
|
||||||
$expires = $token->inserted_at + $token->expires_in;
|
$expires = $token->inserted_at + $token->expires_in;
|
||||||
$tokenExpiration = Carbon::createFromTimeStamp($expires)->toDateTimeString();
|
$tokenExpiration = Carbon::createFromTimeStamp($expires);
|
||||||
|
|
||||||
if($currentTime->greaterThan($tokenExpiration->subSeconds(5))) {
|
if($currentTime->greaterThan($tokenExpiration->subSeconds(5))) {
|
||||||
return true;
|
return true;
|
||||||
@@ -101,7 +101,7 @@ class Esi {
|
|||||||
|
|
||||||
//Check the expiration of the token to see if the token has expired and needs to be refreshed using the refresh token
|
//Check the expiration of the token to see if the token has expired and needs to be refreshed using the refresh token
|
||||||
$expires = $token->inserted_at + $token->expires_in;
|
$expires = $token->inserted_at + $token->expires_in;
|
||||||
$tokenExpiration = Carbon::createFromTimestamp($expires)->toDateTimeString();
|
$tokenExpiration = Carbon::createFromTimestamp($expires);
|
||||||
//If the access token has expired, we need to do a request for a new access token
|
//If the access token has expired, we need to do a request for a new access token
|
||||||
//We give ourselves around 5 seconds leeway in order to deal with an expired token
|
//We give ourselves around 5 seconds leeway in order to deal with an expired token
|
||||||
if($currentTime->greaterThan($tokenExpiration->subSeconds(5))) {
|
if($currentTime->greaterThan($tokenExpiration->subSeconds(5))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user