Reputation: 8350
How to access $auth from a middleware with Nuxt ?
export default function ({ store, redirect }) {
console.log(store.state.foo)
}
Upvotes: 0
Views: 1330
Reputation: 8350
This works but there might be a better answer.
export default function (context) {
if (context.$auth.user.foo) {
context.redirect('/bar')
}
}
Upvotes: 0