Actually fix the endless redirect loop when the application needs a fresh JWT.

This commit is contained in:
Dane Everitt 2018-06-17 15:06:34 -07:00
parent 5c3d3f6ce9
commit 81da55d46b
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,7 @@ return [
| |
*/ */
'lifetime' => env('SESSION_LIFETIME', 10080), 'lifetime' => env('SESSION_LIFETIME', 720),
'expire_on_close' => false, 'expire_on_close' => false,

View File

@ -60,7 +60,8 @@ router.beforeEach((to, from, next) => {
// client side without having to wait for older tokens to pass their expiration time if // client side without having to wait for older tokens to pass their expiration time if
// we lower it. // we lower it.
if (user === null || compareDate(addHours(dateParse(user.getJWT().iat * 1000), 12), new Date()) < 0) { 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');
} }
} }