Skip to content

Conversation

@pratyush07-hub
Copy link
Contributor

This PR fixes an issue where Volto was creating localStorage entries even for anonymous users.
The problem comes from the blocksClipboard reducer being configured as persistent. Even though anonymous users can’t copy or paste blocks, Volto would still create an empty localStorage entry, which isn’t really needed and can be a concern from a privacy (GDPR) point of view.
With this change, Redux state is only saved to localStorage after a user is logged in. For anonymous visitors, nothing is stored.


This PR fixes the issue by:

  1. Check if the user is logged in
    We only act when the user has a valid session (userSession.token).
  2. Save data only for logged-in users
    The clipboard and other persistent data are stored in the browser only when someone is logged in; anonymous visitors are skipped.
  3. Keep browsers clean and private
    Anonymous users no longer get empty localStorage entries, improving privacy and GDPR compliance, while editors’ behavior stays the same.


If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #6997


@pratyush07-hub
Copy link
Contributor Author

@wesleybl The issue is closed as completed, and this PR implements the suggested fix.
I’m happy to update the implementation if you’d prefer a different approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty localstorage entry created even for anonymous users

1 participant