[Vuejs]-Nuxt / Vue redirect if vuex property is undefind not working

0๐Ÿ‘

I managed to get arround this myself by implementing a middleware in the page file itself like so. In case anyone runs into the same issue.

Solution

middleware({ store, redirect }) { // If the user is not authenticated if (store.state.user.user === undefined) { return redirect("/login"); } },

Leave a comment