Skip to content

Commit ca0c35b

Browse files
committed
Avoid getting stuck in an endless redirect loop...
1 parent 1acedc2 commit ca0c35b

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

resources/assets/scripts/router.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ router.beforeEach((to, from, next) => {
5252

5353
const user = store.getters['auth/getUser'];
5454

55-
// If user is trying to access the authentication endpoints but is already authenticated
56-
// don't try to load them, just send the user to the dashboard.
57-
if (to.path.startsWith('/auth')) {
58-
if (user !== null && compareDate(addHours(dateParse(user.getJWT().iat * 1000), 12), new Date()) >= 0) {
59-
return window.location = '/';
60-
}
61-
62-
return next();
63-
}
64-
6555
// If user is trying to access any of the non-authentication endpoints ensure that they have
6656
// a valid, non-expired JWT.
6757
if (!to.path.startsWith('/auth')) {

0 commit comments

Comments
 (0)