diff --git a/client/src/main.js b/client/src/main.js index 52bf2371..24f46f59 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -95,6 +95,7 @@ function redirectUsersToOnboarding(to) { function networkErrorCallback(statusCode) { if (statusCode === 402) { + Vue.$log.debug('status code 402, redirecting'); router.push({name: 'licenseActivation'}, 0); } } @@ -104,17 +105,21 @@ function joiningClass(to) { } router.beforeEach(async (to, from, next) => { + Vue.$log.debug('navigation guard called', to, from); if (to.path === '/logout') { publicApolloClient.resetStore(); if (process.env.LOGOUT_REDIRECT_URL) { location.replace(`https://sso.hep-verlag.ch/logout?return_to=${process.env.LOGOUT_REDIRECT_URL}`); next(false); + return; } else { next({name: 'hello'}); + return; } } if (unauthorizedAccess(to)) { + Vue.$log.debug('unauthorized', to); const postLoginRedirectionUrl = to.path; const redirectUrl = `/hello/`; @@ -147,6 +152,7 @@ router.beforeEach(async (to, from, next) => { return; } + Vue.$log.debug('End of Guard reached', to); next(); });