Skip to content

Commit

Permalink
Catch more occurences where ExpiredTokenException can be thrown
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer authored and Dagefoerde committed Oct 25, 2018
1 parent 49e992c commit 4abae96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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 Down Expand Up @@ -153,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 4abae96

Please sign in to comment.