Skip to content
Snippets Groups Projects
Commit c0d85cd0 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

Redirect to login page if feature not available without active session

parent b836ecbd
No related branches found
No related tags found
1 merge request!812REDMINE_ISSUE-21870 | Problème sur les liens de redirection notification signalement
......@@ -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: '/' });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment