Skip to content

Commit

Permalink
Merge pull request #1771 from AzureAD/msal-common-unifiedCache-update
Browse files Browse the repository at this point in the history
[msal-common][msal-node][#4] Update UnifiedCacheManager.ts
  • Loading branch information
Prithvi Kanherkar committed Jun 18, 2020
2 parents d7675e0 + db09f5e commit 25d53da
Show file tree
Hide file tree
Showing 49 changed files with 1,123 additions and 1,440 deletions.
2 changes: 1 addition & 1 deletion lib/msal-browser/src/app/PublicClientApplication.ts
Expand Up @@ -530,7 +530,7 @@ export class PublicClientApplication {
* @returns {@link IAccount[]} - Array of account objects in cache
*/
public getAllAccounts(): IAccount[] {
return this.authModule.getAllAccounts();
return this.browserStorage.getAllAccounts();
}

/**
Expand Down
5 changes: 3 additions & 2 deletions lib/msal-browser/src/cache/BrowserStorage.ts
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { ICacheStorage, Constants, PersistentCacheKeys, StringUtils, AuthorizationCodeRequest, ICrypto, CacheSchemaType, AccountEntity, IdTokenEntity, CacheHelper, CredentialType, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity } from "@azure/msal-common";
import { Constants, PersistentCacheKeys, StringUtils, AuthorizationCodeRequest, ICrypto, CacheSchemaType, AccountEntity, IdTokenEntity, CacheHelper, CredentialType, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager } from "@azure/msal-common";
import { CacheOptions } from "../config/Configuration";
import { BrowserAuthError } from "../error/BrowserAuthError";
import { BrowserConfigurationAuthError } from "../error/BrowserConfigurationAuthError";
Expand All @@ -16,7 +16,7 @@ const COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
* Cookies are only used if storeAuthStateInCookie is true, and are only used for
* parameters such as state and nonce, generally.
*/
export class BrowserStorage implements ICacheStorage {
export class BrowserStorage extends CacheManager {

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

constructor(clientId: string, cacheConfig: CacheOptions) {
super();
// Validate cache location
this.validateWindowStorage(cacheConfig.cacheLocation);

Expand Down

0 comments on commit 25d53da

Please sign in to comment.