Skip to content

Commit f8b1720

Browse files
refresh more often based on clock skew
1 parent 023cfc9 commit f8b1720

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

extensions/microsoft-authentication/src/AADHelper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ interface ITokenClaims {
4545
tid: string;
4646
email?: string;
4747
unique_name?: string;
48+
exp?: number;
4849
preferred_username?: string;
4950
oid?: string;
5051
altsecid?: string;
@@ -182,6 +183,7 @@ export class AzureActiveDirectoryService {
182183
};
183184
});
184185

186+
Logger.trace('storing data into keychain...');
185187
await this._keychain.setToken(JSON.stringify(serializedData));
186188
}
187189

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

543546
await this.storeTokenData();

0 commit comments

Comments
 (0)