From 4ba9602c908154f946e882feee26473335fbdda8 Mon Sep 17 00:00:00 2001 From: Matthew Hersee Date: Thu, 30 Nov 2017 14:13:46 +0000 Subject: [PATCH] Logout when token expired Updated based on comments in this issue https://github.com/paulvanbladel/aurelia-auth/issues/121 --- dist/amd/authentication.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dist/amd/authentication.js b/dist/amd/authentication.js index 0a187d0..fe3228a 100644 --- a/dist/amd/authentication.js +++ b/dist/amd/authentication.js @@ -147,6 +147,9 @@ define(['exports', 'aurelia-dependency-injection', './base-config', './storage', if (exp) { return Math.round(new Date().getTime() / 1000) <= exp; + } else { + this.logout(); + return false; } return true; @@ -194,4 +197,4 @@ define(['exports', 'aurelia-dependency-injection', './base-config', './storage', return Authentication; }()) || _class); -}); \ No newline at end of file +});