Merge pull request #11964 from nextcloud/bug/11919/do_not_always_fallback
Forwarded ExpiredTokenException
This commit is contained in:
commit
a11bef25a2
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue