@@ -11,7 +11,7 @@ import { ServerCodeRequestParameters } from "../server/ServerCodeRequestParamete
11
11
import { ServerTokenRequestParameters } from "../server/ServerTokenRequestParameters" ;
12
12
import { CodeResponse } from "../response/CodeResponse" ;
13
13
import { TokenResponse } from "../response/TokenResponse" ;
14
- import { SPAResponseHandler } from "../response/SpaResponseHandler " ;
14
+ import { SPAResponseHandler } from "../response/SPAResponseHandler " ;
15
15
import { ServerAuthorizationCodeResponse } from "../server/ServerAuthorizationCodeResponse" ;
16
16
import { ServerAuthorizationTokenResponse } from "../server/ServerAuthorizationTokenResponse" ;
17
17
import { ClientAuthError } from "../error/ClientAuthError" ;
@@ -101,7 +101,7 @@ export class SPAClient extends BaseClient {
101
101
}
102
102
103
103
// Update required cache entries for request.
104
- this . cacheManager . updateCacheEntries ( requestParameters , request . account ) ;
104
+ this . spaCacheManager . updateCacheEntries ( requestParameters , request . account ) ;
105
105
106
106
// Populate query parameters (sid/login_hint/domain_hint) and any other extraQueryParameters set by the developer.
107
107
requestParameters . populateQueryParams ( adalIdToken ) ;
@@ -123,7 +123,7 @@ export class SPAClient extends BaseClient {
123
123
return urlNavigate ;
124
124
} catch ( e ) {
125
125
// Reset cache items before re-throwing.
126
- this . cacheManager . resetTempCacheItems ( requestParameters && requestParameters . state ) ;
126
+ this . spaCacheManager . resetTempCacheItems ( requestParameters && requestParameters . state ) ;
127
127
throw e ;
128
128
}
129
129
}
@@ -171,7 +171,7 @@ export class SPAClient extends BaseClient {
171
171
return await this . getTokenResponse ( tokenEndpoint , tokenReqParams , tokenRequest , codeResponse ) ;
172
172
} catch ( e ) {
173
173
// Reset cache items and set account to null before re-throwing.
174
- this . cacheManager . resetTempCacheItems ( codeResponse && codeResponse . userRequestState ) ;
174
+ this . spaCacheManager . resetTempCacheItems ( codeResponse && codeResponse . userRequestState ) ;
175
175
this . account = null ;
176
176
throw e ;
177
177
}
@@ -243,7 +243,7 @@ export class SPAClient extends BaseClient {
243
243
}
244
244
} catch ( e ) {
245
245
// Reset cache items and set account to null before re-throwing.
246
- this . cacheManager . resetTempCacheItems ( ) ;
246
+ this . spaCacheManager . resetTempCacheItems ( ) ;
247
247
this . account = null ;
248
248
throw e ;
249
249
}
@@ -261,7 +261,7 @@ export class SPAClient extends BaseClient {
261
261
// Check for homeAccountIdentifier. Do not send anything if it doesn't exist.
262
262
const homeAccountIdentifier = currentAccount ? currentAccount . homeAccountIdentifier : "" ;
263
263
// Remove all pertinent access tokens.
264
- this . cacheManager . removeAllAccessTokens ( this . config . authOptions . clientId , authorityUri , "" , homeAccountIdentifier ) ;
264
+ this . spaCacheManager . removeAllAccessTokens ( this . config . authOptions . clientId , authorityUri , "" , homeAccountIdentifier ) ;
265
265
// Clear remaining cache items.
266
266
this . cacheStorage . clear ( ) ;
267
267
// Clear current account.
@@ -298,7 +298,7 @@ export class SPAClient extends BaseClient {
298
298
*/
299
299
public handleFragmentResponse ( hashFragment : string ) : CodeResponse {
300
300
// Handle responses.
301
- const responseHandler = new SPAResponseHandler ( this . config . authOptions . clientId , this . cacheStorage , this . cacheManager , this . cryptoUtils , this . logger ) ;
301
+ const responseHandler = new SPAResponseHandler ( this . config . authOptions . clientId , this . cacheStorage , this . spaCacheManager , this . cryptoUtils , this . logger ) ;
302
302
// Deserialize hash fragment response parameters.
303
303
const hashUrlString = new UrlString ( hashFragment ) ;
304
304
const serverParams = hashUrlString . getDeserializedHash < ServerAuthorizationCodeResponse > ( ) ;
@@ -315,7 +315,7 @@ export class SPAClient extends BaseClient {
315
315
*/
316
316
public cancelRequest ( ) : void {
317
317
const cachedState = this . cacheStorage . getItem ( TemporaryCacheKeys . REQUEST_STATE ) ;
318
- this . cacheManager . resetTempCacheItems ( cachedState || "" ) ;
318
+ this . spaCacheManager . resetTempCacheItems ( cachedState || "" ) ;
319
319
}
320
320
321
321
/**
@@ -329,7 +329,7 @@ export class SPAClient extends BaseClient {
329
329
this . cacheStorage . removeItem ( TemporaryCacheKeys . REQUEST_PARAMS ) ;
330
330
// Get cached authority and use if no authority is cached with request.
331
331
if ( StringUtils . isEmpty ( parsedRequest . authority ) ) {
332
- const authorityKey : string = this . cacheManager . generateAuthorityKey ( state ) ;
332
+ const authorityKey : string = this . spaCacheManager . generateAuthorityKey ( state ) ;
333
333
const cachedAuthority : string = this . cacheStorage . getItem ( authorityKey ) ;
334
334
parsedRequest . authority = cachedAuthority ;
335
335
}
@@ -348,7 +348,7 @@ export class SPAClient extends BaseClient {
348
348
*/
349
349
private getCachedTokens ( requestScopes : ScopeSet , authorityUri : string , resourceId : string , homeAccountIdentifier : string ) : AccessTokenCacheItem {
350
350
// Get all access tokens with matching authority, resource id and home account ID
351
- const tokenCacheItems : Array < AccessTokenCacheItem > = this . cacheManager . getAllAccessTokens ( this . config . authOptions . clientId , authorityUri || "" , resourceId || "" , homeAccountIdentifier || "" ) ;
351
+ const tokenCacheItems : Array < AccessTokenCacheItem > = this . spaCacheManager . getAllAccessTokens ( this . config . authOptions . clientId , authorityUri || "" , resourceId || "" , homeAccountIdentifier || "" ) ;
352
352
if ( tokenCacheItems . length === 0 ) {
353
353
throw ClientAuthError . createNoTokensFoundError ( requestScopes . printScopes ( ) ) ;
354
354
}
@@ -388,7 +388,7 @@ export class SPAClient extends BaseClient {
388
388
) ;
389
389
390
390
// Create response handler
391
- const responseHandler = new SPAResponseHandler ( this . config . authOptions . clientId , this . cacheStorage , this . cacheManager , this . cryptoUtils , this . logger ) ;
391
+ const responseHandler = new SPAResponseHandler ( this . config . authOptions . clientId , this . cacheStorage , this . spaCacheManager , this . cryptoUtils , this . logger ) ;
392
392
// Validate response. This function throws a server error if an error is returned by the server.
393
393
responseHandler . validateServerAuthorizationTokenResponse ( acquiredTokenResponse . body ) ;
394
394
// Return token response with given parameters
0 commit comments