Skip to content

Commit

Permalink
Make the token expiration also work for autocasting 0
Browse files Browse the repository at this point in the history
Some bad databases don't respect the default null apprently.
Now even if they cast it to 0 it should work just fine.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Jun 8, 2018
1 parent 8d26f9c commit 480864b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Authentication/Token/DefaultTokenProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function getToken(string $tokenId): IToken {
throw new InvalidTokenException();
}

if ($token->getExpires() !== null && $token->getExpires() < $this->time->getTime()) {
if ((int)$token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) {
throw new ExpiredTokenException($token);
}

Expand Down

0 comments on commit 480864b

Please sign in to comment.