Generalize refresh failure handling

This commit is contained in:
Jasper Weyne 2020-07-08 17:02:52 +02:00
parent 5df7db5105
commit 97cde9c56a

View File

@ -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