diff --git a/src/router/index.js b/src/router/index.js index 07367355a41d284bce10cb54e920eb2d2979ba48..8a2ed59c0f5ac1db62a5d2fb80113b5122834e21 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -139,7 +139,15 @@ const routes = [ } else if (offset === "No Content") { store.commit('CLEAR_MESSAGES'); // Remove other messages to avoid displaying twice that the user is not connected store.commit('DISPLAY_MESSAGE', { comment: `Vous n'avez pas accès à ce signalement ${store.state.user ? 'avec cet utilisateur' : 'hors connexion, veuillez-vous connecter au préalable'}`, level: 'negative' }); - next({ path: '/' }); + console.log('store', store); + console.log('store.state.configuration.VUE_APP_LOGIN_URL', store.state.configuration.VUE_APP_LOGIN_URL); + if (store.state.configuration.VUE_APP_LOGIN_URL) { + setTimeout(() => { // delay to allow the message to be read by user + window.open(store.state.configuration.VUE_APP_LOGIN_URL) + }, 1500); + } else { + next({ name: 'login' }); + } } else { store.commit('DISPLAY_MESSAGE', { comment: 'Désolé, une erreur est survenue pendant la recherche du signalement', level: 'negative' }); next({ path: '/' });