mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Await keychain write on logout for github auth
This commit is contained in:
parent
37485c2568
commit
fd88fb9667
|
@ -137,7 +137,7 @@ export class GitHubAuthenticationProvider {
|
|||
this._sessions.push(session);
|
||||
}
|
||||
|
||||
this.storeSessions();
|
||||
await this.storeSessions();
|
||||
}
|
||||
|
||||
public async logout(id: string) {
|
||||
|
@ -145,9 +145,13 @@ export class GitHubAuthenticationProvider {
|
|||
if (sessionIndex > -1) {
|
||||
const session = this._sessions.splice(sessionIndex, 1)[0];
|
||||
const token = await session.getAccessToken();
|
||||
await this._githubServer.revokeToken(token);
|
||||
try {
|
||||
await this._githubServer.revokeToken(token);
|
||||
} catch (_) {
|
||||
// ignore, should still remove from keychain
|
||||
}
|
||||
}
|
||||
|
||||
this.storeSessions();
|
||||
await this.storeSessions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,6 +186,7 @@ export class GitHubServer {
|
|||
Logger.info('Revoked token!');
|
||||
resolve();
|
||||
} else {
|
||||
Logger.info(`Revoking token failed: ${result.statusMessage}`);
|
||||
reject(new Error(result.statusMessage));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue