From b602c16eb7997dbec36e39cf0ce0eb0031d39cac Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Mon, 22 Aug 2022 10:46:55 +0100 Subject: [PATCH] fix: try and revoke refresh token even if access token revocation fails --- src/matrix/Client.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/matrix/Client.js b/src/matrix/Client.js index c1d48968..05589606 100644 --- a/src/matrix/Client.js +++ b/src/matrix/Client.js @@ -490,7 +490,14 @@ export class Client { encoding: this._platform.encoding, crypto: this._platform.crypto, }); - await oidcApi.revokeToken({ token: sessionInfo.accessToken, type: "access_token" }); + + // if access token revocation fails then we still want to try and revoke the refresh token + try { + await oidcApi.revokeToken({ token: sessionInfo.accessToken, type: "access_token" }); + } catch (err) { + console.error(err); + } + if (sessionInfo.refreshToken) { await oidcApi.revokeToken({ token: sessionInfo.refreshToken, type: "refresh_token" }); }