[Vuejs]-Vue Routes logout the apps when access the routes manually from search bar

-1👍

I have solved this problem by modifying my Login.vue component. It seems when login component loads, it doesn’t check if user is already signed in or not. To do that, I have dispatch checkAdmin from a method defined in Login.vue when it gets mounted.

That way I can check if user is logged and update the admin state everytime user refreshed the page or go to the default url.

I hope this answer helps someone who is doing all firebase operation inside vuex store and encounter the same problem.

I have decided to move my firebase operation in vuex store just to make my app cleaner.

Leave a comment