mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Fix logout not revoking oidc access token
This commit is contained in:
parent
e09d66a57e
commit
35dbb5a59a
@ -481,12 +481,7 @@ export class Client {
|
||||
throw new Error(`Could not find session for id ${this._sessionId}`);
|
||||
}
|
||||
try {
|
||||
const hsApi = new HomeServerApi({
|
||||
homeserver: sessionInfo.homeServer,
|
||||
accessToken: sessionInfo.accessToken,
|
||||
request: this._platform.request
|
||||
});
|
||||
await hsApi.logout({log}).response();
|
||||
if (sessionInfo.oidcIssuer) {
|
||||
const oidcApi = new OidcApi({
|
||||
issuer: sessionInfo.oidcIssuer,
|
||||
clientConfigs: this._platform.config.oidc.clientConfigs,
|
||||
@ -499,7 +494,17 @@ export class Client {
|
||||
if (sessionInfo.refreshToken) {
|
||||
await oidcApi.revokeToken({ token: sessionInfo.refreshToken, type: "refresh" });
|
||||
}
|
||||
} catch (err) {}
|
||||
} else {
|
||||
const hsApi = new HomeServerApi({
|
||||
homeserver: sessionInfo.homeServer,
|
||||
accessToken: sessionInfo.accessToken,
|
||||
request: this._platform.request
|
||||
});
|
||||
await hsApi.logout({log}).response();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
await this.deleteSession(log);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user