Skip to content

Commit

Permalink
Merge branch 'session-refresh-check' into jspm
Browse files Browse the repository at this point in the history
  • Loading branch information
peteruithoven committed May 22, 2017
2 parents 16fa613 + 31202b4 commit 8fb68c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ class Superlogin extends EventEmitter2 {
if (!this._session || !this._session.user_id) {
return Promise.reject();
}
const refreshed = this._session.refreshed;
// try getting the latest refresh date, if not available fall back to issued date
const refreshed = this._session.refreshed || this._session.issued;
const expires = this._session.expires;
const threshold = isNaN(this._config.refreshThreshold) ? 0.5 : this._config.refreshThreshold;
const duration = expires - refreshed;
Expand Down

0 comments on commit 8fb68c3

Please sign in to comment.