Skip to content

Commit

Permalink
fix: added returnUrl option for came_from parameter (#563)
Browse files Browse the repository at this point in the history
Co-authored-by: Piero Nicolli <[email protected]>
  • Loading branch information
sabrina-bongiovanni and pnicolli authored Mar 4, 2024
1 parent 74d145a commit da80c23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/customizations/volto/components/theme/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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.',
},
Expand Down Expand Up @@ -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$/, '') ||
Expand Down

0 comments on commit da80c23

Please sign in to comment.