Skip to content

Commit 25d53da

Browse files
author
Prithvi Kanherkar
authored
Merge pull request #1771 from AzureAD/msal-common-unifiedCache-update
[msal-common][msal-node][#4] Update UnifiedCacheManager.ts
2 parents d7675e0 + db09f5e commit 25d53da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1123
-1440
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export class PublicClientApplication {
530530
* @returns {@link IAccount[]} - Array of account objects in cache
531531
*/
532532
public getAllAccounts(): IAccount[] {
533-
return this.authModule.getAllAccounts();
533+
return this.browserStorage.getAllAccounts();
534534
}
535535

536536
/**

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License.
44
*/
5-
import { ICacheStorage, Constants, PersistentCacheKeys, StringUtils, AuthorizationCodeRequest, ICrypto, CacheSchemaType, AccountEntity, IdTokenEntity, CacheHelper, CredentialType, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity } from "@azure/msal-common";
5+
import { Constants, PersistentCacheKeys, StringUtils, AuthorizationCodeRequest, ICrypto, CacheSchemaType, AccountEntity, IdTokenEntity, CacheHelper, CredentialType, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager } from "@azure/msal-common";
66
import { CacheOptions } from "../config/Configuration";
77
import { BrowserAuthError } from "../error/BrowserAuthError";
88
import { BrowserConfigurationAuthError } from "../error/BrowserConfigurationAuthError";
@@ -16,7 +16,7 @@ const COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
1616
* Cookies are only used if storeAuthStateInCookie is true, and are only used for
1717
* parameters such as state and nonce, generally.
1818
*/
19-
export class BrowserStorage implements ICacheStorage {
19+
export class BrowserStorage extends CacheManager {
2020

2121
// Cache configuration, either set by user or default values.
2222
private cacheConfig: CacheOptions;
@@ -26,6 +26,7 @@ export class BrowserStorage implements ICacheStorage {
2626
private clientId: string;
2727

2828
constructor(clientId: string, cacheConfig: CacheOptions) {
29+
super();
2930
// Validate cache location
3031
this.validateWindowStorage(cacheConfig.cacheLocation);
3132

0 commit comments

Comments
 (0)