fix: try and revoke refresh token even if access token revocation fails

This commit is contained in:
Hugh Nimmo-Smith 2022-08-22 10:46:55 +01:00
parent 9bf26dadae
commit b602c16eb7

View File

@ -490,7 +490,14 @@ export class Client {
encoding: this._platform.encoding, encoding: this._platform.encoding,
crypto: this._platform.crypto, 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) { if (sessionInfo.refreshToken) {
await oidcApi.revokeToken({ token: sessionInfo.refreshToken, type: "refresh_token" }); await oidcApi.revokeToken({ token: sessionInfo.refreshToken, type: "refresh_token" });
} }