From: Jasper Weyne Date: Wed, 8 Jul 2020 15:02:52 +0000 (+0200) Subject: Generalize refresh failure handling X-Git-Tag: v21.10~1^2~21^2~11^2~8 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/97cde9c56a3268da179c2701d209a9a1224bac85 Generalize refresh failure handling --- diff --git a/app/Auth/Access/OpenIdService.php b/app/Auth/Access/OpenIdService.php index 7b651c3de..14b6ac9a5 100644 --- a/app/Auth/Access/OpenIdService.php +++ b/app/Auth/Access/OpenIdService.php @@ -88,9 +88,10 @@ class OpenIdService extends ExternalAuthService // Refreshing failed, logout $this->actionLogout(); return false; - } catch (InvalidTokenException $e) { - // A refresh token doesn't necessarily contain - // an ID token, ignore this exception + } catch (\Exception $e) { + // Unknown error, logout and throw + $this->actionLogout(); + throw $e; } // A valid token was obtained, we update the access token