diff options
-rw-r--r-- | lib/private/Authentication/Token/PublicKeyTokenProvider.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index 04781457a7a..d2ee47cf380 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -97,12 +97,17 @@ class PublicKeyTokenProvider implements IProvider { $tokenHash = $this->hashToken($tokenId); if (isset($this->cache[$tokenHash])) { + if ($this->cache[$tokenHash] instanceof DoesNotExistException) { + $ex = $this->cache[$tokenHash]; + throw new InvalidTokenException("Token does not exist: " . $ex->getMessage(), 0, $ex); + } $token = $this->cache[$tokenHash]; } else { try { $token = $this->mapper->getToken($this->hashToken($tokenId)); $this->cache[$token->getToken()] = $token; } catch (DoesNotExistException $ex) { + $this->cache[$tokenHash] = $ex; throw new InvalidTokenException("Token does not exist: " . $ex->getMessage(), 0, $ex); } } |