Nuxt/examples/auth-jwt/middleware/authenticated.js

7 lines
149 B
JavaScript
Raw Normal View History

export default function ({ store, redirect }) {
// If the user is not authenticated
if (!store.state.auth) {
return redirect('/login')
}
}