]> source.dussan.org Git - nextcloud-server.git/commitdiff
Catch more occurences where ExpiredTokenException can be thrown 12032/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Sun, 21 Oct 2018 12:37:08 +0000 (14:37 +0200)
committerJan Dageförde <jan.dagefoerde@ercis.uni-muenster.de>
Thu, 25 Oct 2018 08:59:07 +0000 (10:59 +0200)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Authentication/Token/Manager.php

index 3cf48e868b6d045579b610e2f60bb65985aa111a..5fbf78eefd298a1e93026318d273c07a6b9a9758 100644 (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);
                }