Catch more occurences where ExpiredTokenException can be thrown

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-10-21 14:37:08 +02:00
parent b3a92a4e39
commit 34f5f4091e
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 1 deletions

View File

@ -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
}
@ -153,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);
}