From 3a179b2519113ea1712fd5d67ed0a5d942497214 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 19 Sep 2018 17:55:48 +0200 Subject: [PATCH 1/2] Copy the expiration from 480864b3e32d88361b17b70d238f986f64579757 to getTokenById Signed-off-by: Joas Schilling --- lib/private/Authentication/Token/DefaultTokenProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index 8c2d8c33a9..ad45303fa7 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -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); } From 6718bfb83df92d2bec6ae7504fc29a7b27d95f40 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 20 Sep 2018 09:54:27 +0200 Subject: [PATCH 2/2] Also adjust the expiration of PublicKeyTokenProvider Signed-off-by: Joas Schilling --- lib/private/Authentication/Token/PublicKeyTokenProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index 73bd7a711d..fe352d29e0 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -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); }