Permalink
Browse files

fix(authService): storageChangedReload optional (default: false)

  • Loading branch information...
doktordirk committed Oct 13, 2016
1 parent 98b6d52 commit 8c5b1cb2018b98fa08f6b3671b3eb9d8914fea3b
Showing with 8 additions and 1 deletion.
  1. +2 −0 doc/baseConfig.md
  2. +4 −1 src/authService.js
  3. +2 −0 src/baseConfig.js
@@ -123,6 +123,8 @@ platform = 'browser';
storage = 'localStorage';
// The key used for storing the authentication response locally
storageKey = 'aurelia_authentication';
// full page reload if authorization changed in another tab
storageChangedReload = false;
// optional function to extract the expiration date. takes the server response as parameter
// eg (expires_in in sec): getExpirationDateFromResponse = serverResponse => new Date().getTime() + serverResponse.expires_in * 1000;
getExpirationDateFromResponse = null;
@@ -106,7 +106,10 @@ export class AuthService {
if (this.config.storageChangedRedirect) {
PLATFORM.location.href = this.config.storageChangedRedirect;
}
PLATFORM.location.reload();
if (this.config.storageChangedReload) {
PLATFORM.location.reload();
}
}
/**
@@ -151,6 +151,8 @@ export class BaseConfig {
storage = 'localStorage';
// The key used for storing the authentication response locally
storageKey = 'aurelia_authentication';
// full page reload if authorization changed in another tab
storageChangedReload = false;
// optional function to extract the expiration date. takes the server response as parameter
// eg (expires_in in sec): getExpirationDateFromResponse = serverResponse => new Date().getTime() + serverResponse.expires_in * 1000;
getExpirationDateFromResponse = null;

0 comments on commit 8c5b1cb

Please sign in to comment.