Skip to content

Commit eb8174d

Browse files
committed
Merge branch 'dev' of https://github.com/AzureAD/microsoft-authentication-library-for-js into lalimas/browsercachingupdates
2 parents 6eefe24 + 95220b9 commit eb8174d

25 files changed

+1844
-1122
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix typos #5531",
4+
"packageName": "@azure/msal-browser",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Log number of accounts in trace mode. #5529",
4+
"packageName": "@azure/msal-browser",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix typos #5531",
4+
"packageName": "@azure/msal-common",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

extensions/msal-node-extensions/package-lock.json

+19-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lerna.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"lerna": "3.16.4",
32
"command": {
43
"run": {
54
"scope": [

lib/msal-angular/package-lock.json

+30-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/msal-browser/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/msal-browser/src/app/PublicClientApplication.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class PublicClientApplication extends ClientApplication implements IPubli
177177
*/
178178
protected async acquireTokenSilentAsync(request: SilentRequest, account: AccountInfo): Promise<AuthenticationResult>{
179179
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);
180-
const astsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
180+
const atsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
181181

182182
let result: Promise<AuthenticationResult>;
183183
if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId) {
@@ -242,7 +242,7 @@ export class PublicClientApplication extends ClientApplication implements IPubli
242242

243243
return result.then((response) => {
244244
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);
245-
astsAsyncMeasurement.endMeasurement({
245+
atsAsyncMeasurement.endMeasurement({
246246
success: true,
247247
fromCache: response.fromCache,
248248
isNativeBroker: response.fromNativeBroker,
@@ -251,7 +251,7 @@ export class PublicClientApplication extends ClientApplication implements IPubli
251251
return response;
252252
}).catch((tokenRenewalError: AuthError) => {
253253
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);
254-
astsAsyncMeasurement.endMeasurement({
254+
atsAsyncMeasurement.endMeasurement({
255255
errorCode: tokenRenewalError.errorCode,
256256
subErrorCode: tokenRenewalError.subError,
257257
success: false

lib/msal-browser/src/cache/BrowserCacheManager.ts

+11-9
Original file line numberDiff line numberDiff line change
@@ -403,33 +403,33 @@ export class BrowserCacheManager extends CacheManager {
403403
getActiveAccount(): AccountInfo | null {
404404
const activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
405405
const activeAccountValueFilters = this.getItem(activeAccountKeyFilters);
406-
if (!activeAccountValueFilters) {
406+
if (!activeAccountValueFilters) {
407407
// if new active account cache type isn't found, it's an old version, so look for that instead
408-
this.logger.trace("No active account filters cache schema found, looking for legacy schema");
408+
this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");
409409
const activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
410410
const activeAccountValueLocal = this.getItem(activeAccountKeyLocal);
411411
if(!activeAccountValueLocal) {
412-
this.logger.trace("No active account found");
412+
this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
413413
return null;
414414
}
415415
const activeAccount = this.getAccountInfoByFilter({localAccountId: activeAccountValueLocal})[0] || null;
416416
if(activeAccount) {
417-
this.logger.trace("Legacy active account cache schema found");
418-
this.logger.trace("Adding active account filters cache schema");
417+
this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found");
418+
this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema");
419419
this.setActiveAccount(activeAccount);
420420
return activeAccount;
421421
}
422422
return null;
423423
}
424424
const activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters) as AccountInfo;
425425
if(activeAccountValueObj) {
426-
this.logger.trace("Active account filters schema found");
426+
this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found");
427427
return this.getAccountInfoByFilter({
428428
homeAccountId: activeAccountValueObj.homeAccountId,
429429
localAccountId: activeAccountValueObj.localAccountId
430430
})[0] || null;
431431
}
432-
this.logger.trace("No active account found");
432+
this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
433433
return null;
434434
}
435435

@@ -461,6 +461,8 @@ export class BrowserCacheManager extends CacheManager {
461461
*/
462462
getAccountInfoByFilter(accountFilter: Partial<Omit<AccountInfo, "idTokenClaims"|"name">>): AccountInfo[] {
463463
const allAccounts = this.getAllAccounts();
464+
this.logger.trace(`BrowserCacheManager.getAccountInfoByFilter: total ${allAccounts.length} accounts found`);
465+
464466
return allAccounts.filter((accountObj) => {
465467
if (accountFilter.username && accountFilter.username.toLowerCase() !== accountObj.username.toLowerCase()) {
466468
return false;
@@ -1069,10 +1071,10 @@ export class BrowserCacheManager extends CacheManager {
10691071
getRedirectRequestContext(): string | null {
10701072
return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);
10711073
}
1072-
1074+
10731075
/**
10741076
* Sets application id as the redirect context during AcquireTokenRedirect flow.
1075-
* @param value
1077+
* @param value
10761078
*/
10771079
setRedirectRequestContext(value: string): void {
10781080
this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);

lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class BrowserPerformanceClient extends PerformanceClient implements IPerf
1919
this.guidGenerator = new GuidGenerator(this.browserCrypto);
2020
}
2121

22-
startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement {
22+
startPerformanceMeasurement(measureName: string, correlationId: string): IPerformanceMeasurement {
2323
return new BrowserPerformanceMeasurement(measureName, correlationId);
2424
}
2525

0 commit comments

Comments
 (0)