Open
Description
I'm using OAuth 2 with Forge Autodesk, they usually return tokens with expires_in: 3599
.
If I get a token from storage and run
$token = new AccessToken($token);
if ($token->hasExpired()) {
$this->refreshToken($token);
}
$accessToken->hasExpired()
always return false, because on the construct the expiration date is calculated with timeNow + expires_in
.
With this logic, the token will never expire, which is incorrect.
- Is this logic incorrect?
- Am I using OAuth wrong? Am I expected to always refresh the token before using it for the second time, even if it didn't expire?
Metadata
Metadata
Assignees
Labels
No labels