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

refactor: replace cookie storage with a store (pinia) #69

Merged
merged 3 commits into from
Dec 26, 2023

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Dec 26, 2023

What

We currently use cookies to store username & token. But they seem to expire quite quickly (need to re-login often).

It's a good opportunity to replace this with a store : pinia

Next step: persist the store in the localstorage

@raphodn raphodn self-assigned this Dec 26, 2023
@raphodn raphodn merged commit 39ffc25 into master Dec 26, 2023
@raphodn raphodn deleted the raphodn/store-pinia branch December 26, 2023 00:30
@raphodn raphodn linked an issue Dec 26, 2023 that may be closed by this pull request
@raphodn
Copy link
Member Author

raphodn commented Dec 26, 2023

Is localStorage less secure than cookie ? for instance this article : https://dev.to/rdegges/please-stop-using-local-storage-1i04

  • see the comments : cookies are very limited in size, hard to manage
  • localStorage is vulnerable to XSS attack, depends on scripts that are imported (but if XSS, then cookies vulnerable as well ?
  • there's always the possibility to revert token storage to cookies, BUT need also to implement cookie authentication + httpOnly + SameSite=strict (was using bearer token for now)
  • idea of setting an expiry date to tokens (but the user will need to sign in again ??)

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.

Add a store for state management: pinia
1 participant