Permalink
Browse files

feat(authentication): add option to always store all received properties

  • Loading branch information...
diegotroitino committed Feb 20, 2018
1 parent 0f80003 commit be7c530e9487df980f680dfaa73cdcd6ee51cb20
Showing with 7 additions and 0 deletions.
  1. +4 −0 src/authentication.js
  2. +3 −0 src/baseConfig.js
@@ -83,6 +83,10 @@ export class Authentication {
setResponseObject(response: {}) {
if (response) {
if (this.config.keepOldResponseProperties){
var oldResponse = this.getResponseObject();
response = Object.assign({}, oldResponse, response);
}
this.getDataFromResponse(response);
this.storage.set(this.config.storageKey, JSON.stringify(response));
@@ -130,6 +130,9 @@ export class BaseConfig {
// The property name used to send the existing token when refreshing `{ "refreshTokenSubmitProp": '...' }`
refreshTokenSubmitProp = 'refresh_token';
// Option to always store all received properties. This allows to work with a single refresh_token that was received once and the expiration only is extend
keepOldResponseProperties = false;
// If the property defined by `refreshTokenProp` is an object:
// -----------------------------------------------------------

0 comments on commit be7c530

Please sign in to comment.