mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
Await keychain write on logout for github auth
This commit is contained in:
@@ -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));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user