Skip to content

Commit

Permalink
no longer removes expired satellizer token
Browse files Browse the repository at this point in the history
  • Loading branch information
sahat committed Feb 16, 2016
1 parent 26df2c8 commit b23cc7e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions satellizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
*/
Shared.isAuthenticated = function() {
var token = storage.get(tokenName);

// A token is present
if (token) {
// Token with a valid JWT format XXX.YYY.ZZZ
Expand All @@ -372,7 +371,6 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
var isExpired = Math.round(new Date().getTime() / 1000) >= exp;
if (isExpired) {
// FAIL: Expired token
storage.remove(tokenName);
return false;
} else {
// PASS: Non-expired token
Expand Down
Loading

1 comment on commit b23cc7e

@daniel-seitz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was done to be able to refresh the token after it expired. However as #777 points out, the token doesn't get sent, yet because the Auth-Header is not set anymore in that case. If there is a reason for this we need to discuss more, else please sent the Header if also if a token is present but expired.

Please sign in to comment.