Skip to content

Commit

Permalink
Bug 1310035: display 'sign in' when credentials are expired at page l…
Browse files Browse the repository at this point in the history
…oad (#167)
  • Loading branch information
djmitche authored and eliperelman committed Oct 27, 2016
1 parent 268b487 commit 607caa0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ export const loadCredentials = () => {

if (creds.certificate && creds.certificate.expiry < Date.now()) {
saveCredentials(null); // clear credentials
} else if (creds.certificate) {
clearTimeout(credentialsExpiredTimeout);
return null;
}

clearTimeout(credentialsExpiredTimeout);
if (creds.certificate) {
credentialsExpiredTimeout = setTimeout(() => saveCredentials(null),
creds.certificate.expiry - Date.now());
} else {
clearTimeout(credentialsExpiredTimeout);
credentialsExpiredTimeout = null;
}

Expand Down

0 comments on commit 607caa0

Please sign in to comment.