Skip to content

Commit 4d2dc65

Browse files
committed
change name of var from cacheStorage to cacheManager
1 parent 0a00a2d commit 4d2dc65

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

lib/msal-common/src/client/AuthorizationCodeClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class AuthorizationCodeClient extends BaseClient {
5353

5454
const responseHandler = new ResponseHandler(
5555
this.config.authOptions.clientId,
56-
this.cacheStorage,
56+
this.cacheManager,
5757
this.cryptoUtils,
5858
this.logger
5959
);

lib/msal-common/src/client/BaseClient.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export abstract class BaseClient {
2828
protected cryptoUtils: ICrypto;
2929

3030
// Storage Interface
31-
protected cacheStorage: CacheManager;
31+
protected cacheManager: CacheManager;
3232

3333
// Network Interface
3434
protected networkClient: INetworkModule;
@@ -47,7 +47,7 @@ export abstract class BaseClient {
4747
this.cryptoUtils = this.config.cryptoInterface;
4848

4949
// Initialize storage interface
50-
this.cacheStorage = this.config.storageInterface;
50+
this.cacheManager = this.config.storageInterface;
5151

5252
// Set the network interface
5353
this.networkClient = this.config.networkInterface;

lib/msal-common/src/client/RefreshTokenClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class RefreshTokenClient extends BaseClient {
2828

2929
const responseHandler = new ResponseHandler(
3030
this.config.authOptions.clientId,
31-
this.cacheStorage,
31+
this.cacheManager,
3232
this.cryptoUtils,
3333
this.logger
3434
);

lib/msal-common/src/client/SPAClient.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class SPAClient extends BaseClient {
214214
const requestScopes = new ScopeSet(request.scopes || []);
215215

216216
// Get current cached tokens
217-
const cachedAccount = this.cacheStorage.getAccount(CacheHelper.generateAccountCacheKey(request.account));
217+
const cachedAccount = this.cacheManager.getAccount(CacheHelper.generateAccountCacheKey(request.account));
218218

219219
const homeAccountId = cachedAccount.homeAccountId;
220220
const env = cachedAccount.environment;
@@ -286,7 +286,7 @@ export class SPAClient extends BaseClient {
286286
*/
287287
async logout(account: IAccount, acquireTokenAuthority: Authority): Promise<string> {
288288
// Clear current account.
289-
this.cacheStorage.removeAccount(CacheHelper.generateAccountCacheKey(account));
289+
this.cacheManager.removeAccount(CacheHelper.generateAccountCacheKey(account));
290290
// Get postLogoutRedirectUri.
291291
let postLogoutRedirectUri = "";
292292
try {
@@ -329,7 +329,7 @@ export class SPAClient extends BaseClient {
329329
*/
330330
public handleFragmentResponse(hashFragment: string, cachedState: string): string {
331331
// Handle responses.
332-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheStorage, this.cryptoUtils, this.logger);
332+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger);
333333
// Deserialize hash fragment response parameters.
334334
const hashUrlString = new UrlString(hashFragment);
335335
const serverParams = hashUrlString.getDeserializedHash<ServerAuthorizationCodeResponse>();
@@ -355,7 +355,7 @@ export class SPAClient extends BaseClient {
355355
this.config.authOptions.clientId,
356356
inputRealm
357357
);
358-
return this.cacheStorage.getCredential(idTokenKey) as IdTokenEntity;
358+
return this.cacheManager.getCredential(idTokenKey) as IdTokenEntity;
359359
}
360360

361361
/**
@@ -372,7 +372,7 @@ export class SPAClient extends BaseClient {
372372
realm: inputRealm,
373373
target: scopes.printScopes()
374374
};
375-
const credentialCache: CredentialCache = this.cacheStorage.getCredentialsFilteredBy(accessTokenFilter);
375+
const credentialCache: CredentialCache = this.cacheManager.getCredentialsFilteredBy(accessTokenFilter);
376376
const accessTokens = Object.values(credentialCache.accessTokens);
377377
if (accessTokens.length > 1) {
378378
// TODO: Figure out what to throw or return here.
@@ -393,7 +393,7 @@ export class SPAClient extends BaseClient {
393393
CredentialType.REFRESH_TOKEN,
394394
this.config.authOptions.clientId
395395
);
396-
return this.cacheStorage.getCredential(refreshTokenKey) as RefreshTokenEntity;
396+
return this.cacheManager.getCredential(refreshTokenKey) as RefreshTokenEntity;
397397
}
398398

399399
/**
@@ -428,7 +428,7 @@ export class SPAClient extends BaseClient {
428428
});
429429

430430
// Create response handler
431-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheStorage, this.cryptoUtils, this.logger);
431+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger);
432432
// Validate response. This function throws a server error if an error is returned by the server.
433433
responseHandler.validateTokenResponse(acquiredTokenResponse.body);
434434
// Return token response with given parameters
@@ -517,7 +517,7 @@ export class SPAClient extends BaseClient {
517517
* @returns {@link Account} - the account object stored in MSAL
518518
*/
519519
getAccount(homeAccountIdentifier: string, env?: string, rlm?: string): AccountEntity {
520-
const accountCache = this.cacheStorage.getAccountsFilteredBy({
520+
const accountCache = this.cacheManager.getAccountsFilteredBy({
521521
homeAccountId: homeAccountIdentifier,
522522
environment: env,
523523
realm: rlm

lib/msal-common/src/client/SilentFlowClient.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class SilentFlowClient extends BaseClient {
4040
const requestScopes = new ScopeSet(request.scopes || []);
4141
// fetch account
4242
const accountKey: string = CacheHelper.generateAccountCacheKey(request.account);
43-
const cachedAccount = this.cacheStorage.getAccount(accountKey);
43+
const cachedAccount = this.cacheManager.getAccount(accountKey);
4444

4545
const homeAccountId = cachedAccount.homeAccountId;
4646
const environment = cachedAccount.environment;
@@ -96,7 +96,7 @@ export class SilentFlowClient extends BaseClient {
9696
this.config.authOptions.clientId,
9797
inputRealm
9898
);
99-
return this.cacheStorage.getCredential(idTokenKey) as IdTokenEntity;
99+
return this.cacheManager.getCredential(idTokenKey) as IdTokenEntity;
100100
}
101101

102102
/**
@@ -113,7 +113,7 @@ export class SilentFlowClient extends BaseClient {
113113
realm: inputRealm,
114114
target: scopes.printScopes()
115115
};
116-
const credentialCache: CredentialCache = this.cacheStorage.getCredentialsFilteredBy(accessTokenFilter);
116+
const credentialCache: CredentialCache = this.cacheManager.getCredentialsFilteredBy(accessTokenFilter);
117117
const accessTokens = Object.values(credentialCache.accessTokens);
118118
if (accessTokens.length > 1) {
119119
// TODO: Figure out what to throw or return here.
@@ -134,7 +134,7 @@ export class SilentFlowClient extends BaseClient {
134134
CredentialType.REFRESH_TOKEN,
135135
this.config.authOptions.clientId
136136
);
137-
return this.cacheStorage.getCredential(refreshTokenKey) as RefreshTokenEntity;
137+
return this.cacheManager.getCredential(refreshTokenKey) as RefreshTokenEntity;
138138
}
139139

140140
/**

0 commit comments

Comments
 (0)