Skip to content
Snippets Groups Projects
Commit a61238cb authored by Camille Blanchon's avatar Camille Blanchon
Browse files

Merge branch 'redmine-issues/19725' into 'develop'

REDMINE_ISSUE-19725 | Redirection vers la page de connexion du portail MRN si l'utilisateur n'est pas connecté

See merge request !843
parents ea520df0 2cf8aa09
No related branches found
No related tags found
1 merge request!843REDMINE_ISSUE-19725 | Redirection vers la page de connexion du portail MRN si l'utilisateur n'est pas connecté
...@@ -204,7 +204,7 @@ const routes = [ ...@@ -204,7 +204,7 @@ const routes = [
}, },
{ {
path: `/projet/:slug/type-signalement/:slug_type_signal/signalement/:slug_signal/attachment-preview/`, path: '/projet/:slug/type-signalement/:slug_type_signal/signalement/:slug_signal/attachment-preview/',
name: 'attachment-preview', name: 'attachment-preview',
component: () => import('../views/AttachmentPreview.vue') component: () => import('../views/AttachmentPreview.vue')
}, },
......
<template> <template>
<div <div
v-if="configuration.VUE_APP_SSO_LOGIN_URL_WITH_REDIRECT && !user || !currentFeature" v-if="(configuration.VUE_APP_SSO_LOGIN_URL_WITH_REDIRECT && !user) || !currentFeature"
class="no-access" class="no-access"
> >
<h3>🔒&nbsp;Vous n'avez pas accès à ce signalement <span v-if="!user"> en tant qu'utilisateur anonyme&nbsp;🥸</span></h3> <h3>
<p v-if="!user">Veuillez vous connectez afin de pouvoir visualiser le document</p> 🔒&nbsp;Vous n'avez pas accès à ce signalement
<span v-if="!user"> en tant qu'utilisateur anonyme&nbsp;🥸</span>
</h3>
<p v-if="!user">
Veuillez vous connectez afin de pouvoir visualiser le document
</p>
</div> </div>
<div <div
...@@ -49,11 +54,30 @@ export default { ...@@ -49,11 +54,30 @@ export default {
}, },
}, },
watch: {
user() {
/**
* Specific for platform with login by token
* When the user is setted, fetching again the feature with the cookies setted
* since automatic authentification can take time to return the response
* setting the cookies, while the app is loading already
*/
this.getFeature();
}
},
mounted() { mounted() {
this.$store.dispatch('feature/GET_PROJECT_FEATURE', { this.getFeature();
project_slug: this.$route.params.slug, },
feature_id: this.$route.params.slug_signal,
}) methods: {
getFeature() {
console.log('getFeature'); // Keeping for debugging after deployment
this.$store.dispatch('feature/GET_PROJECT_FEATURE', {
project_slug: this.$route.params.slug,
feature_id: this.$route.params.slug_signal,
});
}
} }
}; };
</script> </script>
......
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