Skip to content

Commit 42f9ab2

Browse files
committed
Add to if statement so that we clear cache only if we aren't in the middle of processing.
1 parent 79271fc commit 42f9ab2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,11 @@ export class PublicClientApplication {
102102
// Initialize default authority instance
103103
TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.knownAuthorities, this.config.auth.cloudDiscoveryMetadata);
104104

105-
this.defaultAuthorityPromise = AuthorityFactory.createDiscoveredInstance(
106-
this.config.auth.authority,
107-
this.networkClient
108-
);
105+
this.defaultAuthorityPromise = AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.networkClient);
109106

110107
const { location: { hash } } = window;
111-
if (StringUtils.isEmpty(hash)) {
108+
const cachedHash = this.browserStorage.getItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH), CacheSchemaType.TEMPORARY) as string;
109+
if (StringUtils.isEmpty(hash) && StringUtils.isEmpty(cachedHash)) {
112110
// There is no hash - assume we are in clean state and clear any current request data.
113111
this.browserStorage.cleanRequest();
114112
}

0 commit comments

Comments
 (0)