Skip to content

[msal-common][msal-node][#4] Update UnifiedCacheManager.ts #1771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/msal-browser/src/app/PublicClientApplication.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading