Merge pull request #11302 from nextcloud/backport/11297/this-database-dude
[stable14] Fix expiration code of tokens
This commit is contained in:
commit
ea73f30d77
|
@ -184,7 +184,7 @@ class DefaultTokenProvider implements IProvider {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
throw new InvalidTokenException();
|
||||
}
|
||||
|
||||
if ($token->getExpires() !== null && $token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) {
|
||||
if ((int)$token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) {
|
||||
throw new ExpiredTokenException($token);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue