Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
fix(authService): storage events do not work properly in IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Willden committed Sep 19, 2016
1 parent 1aa8b05 commit 944a716
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/authService.js
Expand Up @@ -84,6 +84,14 @@ export class AuthService {


LogManager.getLogger('authentication').info('Stored token changed event'); LogManager.getLogger('authentication').info('Stored token changed event');


// IE runs the event handler before updating the storage value. Update it now.
// An unset storage key in IE is an empty string, where-as chrome is null
if (event.newValue) {
this.authentication.storage.set(this.config.storageKey, event.newValue);
} else {
this.authentication.storage.remove(this.config.storageKey);
}

let wasAuthenticated = this.authenticated; let wasAuthenticated = this.authenticated;
this.authentication.responseAnalyzed = false; this.authentication.responseAnalyzed = false;
this.updateAuthenticated(); this.updateAuthenticated();
Expand Down

0 comments on commit 944a716

Please sign in to comment.