Skip to content

Commit

Permalink
Merge pull request #12032 from Dagefoerde/stable14-11919-do-not-alway…
Browse files Browse the repository at this point in the history
…s-fallback

[stable14] Forwarded ExpiredTokenException
  • Loading branch information
rullzer authored Oct 25, 2018
2 parents f8c3b1d + 4abae96 commit 6c6793f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/private/Authentication/Token/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public function getTokenByUser(string $uid): array {
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
}

Expand All @@ -138,6 +140,8 @@ public function getToken(string $tokenId): IToken {
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);
}
Expand All @@ -151,6 +155,8 @@ public function getTokenById(int $tokenId): IToken {
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);
}
Expand Down

0 comments on commit 6c6793f

Please sign in to comment.