Skip to content

Commit 81da55d

Browse files
committed
Actually fix the endless redirect loop when the application needs a fresh JWT.
1 parent 5c3d3f6 commit 81da55d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

config/session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
|
2929
*/
3030

31-
'lifetime' => env('SESSION_LIFETIME', 10080),
31+
'lifetime' => env('SESSION_LIFETIME', 720),
3232

3333
'expire_on_close' => false,
3434

resources/assets/scripts/router.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ router.beforeEach((to, from, next) => {
6060
// client side without having to wait for older tokens to pass their expiration time if
6161
// we lower it.
6262
if (user === null || compareDate(addHours(dateParse(user.getJWT().iat * 1000), 12), new Date()) < 0) {
63-
return window.location = route('auth.login');
63+
store.commit('auth/logout');
64+
return window.location = route('auth.logout');
6465
}
6566
}
6667

0 commit comments

Comments
 (0)