diff --git a/RELEASE.md b/RELEASE.md index 8e3b3401b..8a4b2fa83 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -36,6 +36,10 @@ - Migliorata l'accessibilità del menu in versione mobile. +### Fix + +- Quando si clicca sul bottone di login da una pagina specifica, dopo il login si viene reindirizzati alla pagina di provenienza. + ## Versione 7.25.2 (04/03/2024) ### Fix diff --git a/src/customizations/volto/components/theme/Login/Login.jsx b/src/customizations/volto/components/theme/Login/Login.jsx index 87270b798..49079e49d 100644 --- a/src/customizations/volto/components/theme/Login/Login.jsx +++ b/src/customizations/volto/components/theme/Login/Login.jsx @@ -24,6 +24,7 @@ import { withRouter } from 'react-router-dom'; import { Icon } from '@plone/volto/components'; import { login } from '@plone/volto/actions'; +import { flattenToAppURL } from '@plone/volto/helpers'; import { toast } from 'react-toastify'; import { Toast } from '@plone/volto/components'; @@ -62,8 +63,7 @@ const messages = defineMessages({ defaultMessage: 'Login Failed', }, loginFailedContent: { - id: - 'Both email address and password are case sensitive, check that caps lock is not enabled.', + id: 'Both email address and password are case sensitive, check that caps lock is not enabled.', defaultMessage: 'Both email address and password are case sensitive, check that caps lock is not enabled.', }, @@ -316,6 +316,7 @@ export default compose( token: state.userSession.token, returnUrl: qs.parse(props.location.search).return_url || + flattenToAppURL(qs.parse(props.location.search).came_from) || props.location.pathname .replace(/\/login$/, '') .replace(/\/logout$/, '') ||