I have the following Vuex store (main.js):
import Vue from \'vue\'
import Vuex from \'vuex\'
Vue.use(Vuex)
//init sto
This is how i would to it.
In App.vue, I will keep a watcher on cookie that stores authentication details. ( Obviously I would store a token containing authentication details as cookie after authentication )
Now whenever this cookie becomes empty, I will route the user to /login page. Logging out deletes the cookie. Now if user hit back after logging out, now since the cookie doesnot exist, ( which requires user to be logged in ), user will be routed to login page.