Add some logging

This commit is contained in:
Ramon Wenger 2022-01-11 15:03:27 +01:00
parent 9bbd6a12de
commit ddc484e0f3
1 changed files with 6 additions and 0 deletions

View File

@ -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();
});