How to persist current user data in VueJS app? Right now I create in my router
an beforeEnter
and fetch current user data from server, but this solution make very slow my app because i need launch this request before every page...
beforeEnter: (to, from, next) => {
UserService.getUserDate().then(response => {
store.auth.user = response.data;
next();
})
}
I think about after first login to system, fetch data of the user and persist it in localStorage
, but it is save?
thanks for any help