From ca0c35bf826e950f80c3c128b40b1ffd98f4e456 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 16 Jun 2018 14:27:23 -0700 Subject: [PATCH] Avoid getting stuck in an endless redirect loop... --- resources/assets/scripts/router.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/resources/assets/scripts/router.js b/resources/assets/scripts/router.js index 2eaff883..fc86b4a6 100644 --- a/resources/assets/scripts/router.js +++ b/resources/assets/scripts/router.js @@ -52,16 +52,6 @@ router.beforeEach((to, from, next) => { const user = store.getters['auth/getUser']; - // If user is trying to access the authentication endpoints but is already authenticated - // don't try to load them, just send the user to the dashboard. - if (to.path.startsWith('/auth')) { - if (user !== null && compareDate(addHours(dateParse(user.getJWT().iat * 1000), 12), new Date()) >= 0) { - return window.location = '/'; - } - - return next(); - } - // If user is trying to access any of the non-authentication endpoints ensure that they have // a valid, non-expired JWT. if (!to.path.startsWith('/auth')) {