From 81da55d46b2dfa4221cfb1fab498523f3763c382 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 17 Jun 2018 15:06:34 -0700 Subject: [PATCH] Actually fix the endless redirect loop when the application needs a fresh JWT. --- config/session.php | 2 +- resources/assets/scripts/router.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/session.php b/config/session.php index 4f3a2e6de..2007acb2e 100644 --- a/config/session.php +++ b/config/session.php @@ -28,7 +28,7 @@ return [ | */ - 'lifetime' => env('SESSION_LIFETIME', 10080), + 'lifetime' => env('SESSION_LIFETIME', 720), 'expire_on_close' => false, diff --git a/resources/assets/scripts/router.js b/resources/assets/scripts/router.js index fc86b4a6e..422c8474e 100644 --- a/resources/assets/scripts/router.js +++ b/resources/assets/scripts/router.js @@ -60,7 +60,8 @@ router.beforeEach((to, from, next) => { // client side without having to wait for older tokens to pass their expiration time if // we lower it. if (user === null || compareDate(addHours(dateParse(user.getJWT().iat * 1000), 12), new Date()) < 0) { - return window.location = route('auth.login'); + store.commit('auth/logout'); + return window.location = route('auth.logout'); } }