Quick story of my problem:
- Absolutely no data is stored in my vuex state when the page loads
- If the user is logged in(or has info stored in
window.localStorage
and therefore gets auto logged in) my vuex store retrieves all the info from a socket that requires authentication. - Then the user logs out, But my vuex state save still retains all its data
This would be a security issue as not logged in people(or hackers) on a public pc could view what the state was before the user logged out.
I have seen How to clear state in vuex store? But I feel that this is a hack and should be avoided.
My current solution is just to refresh the page using location.reload();
Is there a better way to prevent this data leak?
replaceState(start_state)
, but this isn't such a great solution – Breazeale