Skip to content

Commit

Permalink
Remove cache cleanup code for redirects from constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
pkanher617 committed Jul 2, 2020
1 parent 54cac51 commit b5c80f1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/msal-browser/src/app/PublicClientApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ export class PublicClientApplication implements IPublicClientApplication {
TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.knownAuthorities, this.config.auth.cloudDiscoveryMetadata);

this.defaultAuthority = null;

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

// #region Redirect Flow
Expand Down Expand Up @@ -177,8 +170,9 @@ export class PublicClientApplication implements IPublicClientApplication {
* @param interactionHandler
*/
private async handleHash(responseHash: string): Promise<AuthenticationResult> {
// There is no hash - return null.
// There is no hash - clean cache and return null.
if (StringUtils.isEmpty(responseHash)) {
this.browserStorage.cleanRequest();
return null;
}

Expand Down

0 comments on commit b5c80f1

Please sign in to comment.