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

encode url_redirect to prevent cutting off query params

parent 36e807d6
No related branches found
No related tags found
No related merge requests found
......@@ -220,7 +220,7 @@ export default new Vuex.Store({
comment: 'Vous allez être redirigé vers la plateforme de connexion.'
});
// Call the SSO login plateform with url to redirect after login
window.open(`${state.configuration.VUE_APP_SSO_LOGIN_URL_WITH_REDIRECT}/?url_redirect=${window.location.href}`, '_self');
window.open(`${state.configuration.VUE_APP_SSO_LOGIN_URL_WITH_REDIRECT}/?url_redirect=${encodeURIComponent(window.location.href)}`, '_self');
} else {
// If the user is not logged in, display an info message
commit('DISPLAY_MESSAGE', {
......@@ -259,7 +259,7 @@ export default new Vuex.Store({
const index = url_redirect.indexOf(substringToRemove);
// If found, keep only the remaining part after the substring to remove
if (index !== -1) {
url_redirect = index !== -1 ? url_redirect.substring(index + substringToRemove.length) : url_redirect;
url_redirect = url_redirect.substring(index + substringToRemove.length);
}
// catch error from the router, because of second redirection to feature when call with a feature's id
router.push(url_redirect).catch((e) => e);
......
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