Skip to content

Commit

Permalink
refresh more often based on clock skew
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt committed Nov 11, 2021
1 parent 023cfc9 commit f8b1720
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extensions/microsoft-authentication/src/AADHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface ITokenClaims {
tid: string;
email?: string;
unique_name?: string;
exp?: number;
preferred_username?: string;
oid?: string;
altsecid?: string;
Expand Down Expand Up @@ -182,6 +183,7 @@ export class AzureActiveDirectoryService {
};
});

Logger.trace('storing data into keychain...');
await this._keychain.setToken(JSON.stringify(serializedData));
}

Expand Down Expand Up @@ -537,7 +539,8 @@ export class AzureActiveDirectoryService {
onDidChangeSessions.fire({ added: [], removed: [this.convertToSessionSync(token)], changed: [] });
}
}
}, 1000 * (token.expiresIn - 30)));
// For details on why this is set to 2/3... see https://github.com/microsoft/vscode/issues/133201#issuecomment-966668197
}, 1000 * (token.expiresIn * 2 / 3)));
}

await this.storeTokenData();
Expand Down

0 comments on commit f8b1720

Please sign in to comment.