Exploring ways to trigger a route change from the store. I attempted to import router
directly into the store and use the following code:
LOG_OUT({commit}){
commit('LOG_OUT__MUTATION');
router.push({
name: 'Login'
})
}
Unfortunately, this approach did not yield the desired result.
I am hesitant to handle route changes within components as it would demand authentication checks and route changes in every component, which feels overly burdensome.
Edit:
The LOG_OUT__MUTATION
function clears the token stored in the state.