Github auth provider - revoke token on logout

This commit is contained in:
Rachel Macfarlane
2020-03-28 08:14:53 -07:00
parent 8f0d113460
commit 7ca13ca33b
2 changed files with 45 additions and 1 deletions

View File

@@ -142,7 +142,9 @@ export class GitHubAuthenticationProvider {
public async logout(id: string) {
const sessionIndex = this._sessions.findIndex(session => session.id === id);
if (sessionIndex > -1) {
this._sessions.splice(sessionIndex, 1);
const session = this._sessions.splice(sessionIndex, 1)[0];
const token = await session.getAccessToken();
await this._githubServer.revokeToken(token);
}
this.storeSessions();