Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear localStorage on user logout #66

Closed
wants to merge 1 commit into from

Conversation

sweep-ai[bot]
Copy link

@sweep-ai sweep-ai bot commented Aug 3, 2023

Description

This PR addresses the issue #64 by modifying the logout functionality to clear the localStorage when a user logs out. Currently, the application does not clear the localStorage, which can lead to potential security risks and incorrect user data being displayed if a new user logs in on the same browser.

Summary of Changes

  • In server.js, modified the logout route handler to include a flag clearLocalStorage: true in the JSON response.
  • In src/authentication/firebase.js, added a condition to check for the clearLocalStorage flag in the logout response from the server. If it's true, the localStorage is cleared using localStorage.clear().

This change ensures that the localStorage is cleared when a user logs out, providing a more secure and accurate user experience.

Fixes #64.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/clear-localstorage-on-logout

To make tweaks to this pull request, leave a comment below or in the code.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 3, 2023
@egonSchiele egonSchiele closed this Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: when a user logs out, clear localStorage
1 participant