mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Add missing change session events to ms auth provider
This commit is contained in:
parent
b0bbf9c19e
commit
05e970086c
|
@ -657,7 +657,8 @@ export class AzureActiveDirectoryService {
|
|||
|
||||
this._refreshTimeouts.set(sessionId, setTimeout(async () => {
|
||||
try {
|
||||
await this.refreshToken(refreshToken, scope, sessionId);
|
||||
const refreshedToken = await this.refreshToken(refreshToken, scope, sessionId);
|
||||
onDidChangeSessions.fire({ added: [], removed: [], changed: [this.convertToSessionSync(refreshedToken)] });
|
||||
} catch (e) {
|
||||
this.pollForReconnect(sessionId, refreshToken, scope);
|
||||
}
|
||||
|
@ -671,21 +672,14 @@ export class AzureActiveDirectoryService {
|
|||
return resolve(false);
|
||||
}
|
||||
|
||||
if (attempts === 1) {
|
||||
const token = this._tokens.find(token => token.sessionId === sessionId);
|
||||
if (token) {
|
||||
token.accessToken = undefined;
|
||||
onDidChangeSessions.fire({ added: [], removed: [], changed: [this.convertToSessionSync(token)] });
|
||||
}
|
||||
}
|
||||
|
||||
const delayBeforeRetry = 5 * attempts * attempts;
|
||||
|
||||
this.clearSessionTimeout(sessionId);
|
||||
|
||||
this._refreshTimeouts.set(sessionId, setTimeout(async () => {
|
||||
try {
|
||||
await this.refreshToken(refreshToken, scope, sessionId);
|
||||
const refreshedToken = await this.refreshToken(refreshToken, scope, sessionId);
|
||||
onDidChangeSessions.fire({ added: [], removed: [], changed: [this.convertToSessionSync(refreshedToken)] });
|
||||
return resolve(true);
|
||||
} catch (e) {
|
||||
return resolve(await this.handleRefreshNetworkError(sessionId, refreshToken, scope, attempts + 1));
|
||||
|
|
Loading…
Reference in a new issue