diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-10-23 15:07:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 15:07:19 +0200 |
commit | a11bef25a2dbc587f36a08dbb7384518d8f33860 (patch) | |
tree | fbc911c02e1e3cbe36ada71ab64a96fb76578f22 /lib | |
parent | 59e353b05bad71395583d55d768cd765eb4b34da (diff) | |
parent | 34f5f4091e276b4074512283c9b46a125f16463c (diff) | |
download | nextcloud-server-a11bef25a2dbc587f36a08dbb7384518d8f33860.tar.gz nextcloud-server-a11bef25a2dbc587f36a08dbb7384518d8f33860.zip |
Merge pull request #11964 from nextcloud/bug/11919/do_not_always_fallback
Forwarded ExpiredTokenException
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Authentication/Token/Manager.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/Manager.php b/lib/private/Authentication/Token/Manager.php index 7c991eadea9..98a48f41523 100644 --- a/lib/private/Authentication/Token/Manager.php +++ b/lib/private/Authentication/Token/Manager.php @@ -112,7 +112,9 @@ class Manager implements IProvider { public function getToken(string $tokenId): IToken { try { return $this->publicKeyTokenProvider->getToken($tokenId); - } catch (InvalidTokenException $e) { + } catch (ExpiredTokenException $e) { + throw $e; + } catch(InvalidTokenException $e) { // No worries we try to convert it to a PublicKey Token } @@ -138,6 +140,8 @@ class Manager implements IProvider { public function getTokenById(int $tokenId): IToken { try { return $this->publicKeyTokenProvider->getTokenById($tokenId); + } catch (ExpiredTokenException $e) { + throw $e; } catch (InvalidTokenException $e) { return $this->defaultTokenProvider->getTokenById($tokenId); } @@ -151,6 +155,8 @@ class Manager implements IProvider { public function renewSessionToken(string $oldSessionId, string $sessionId) { try { $this->publicKeyTokenProvider->renewSessionToken($oldSessionId, $sessionId); + } catch (ExpiredTokenException $e) { + throw $e; } catch (InvalidTokenException $e) { $this->defaultTokenProvider->renewSessionToken($oldSessionId, $sessionId); } |