Nuxt/examples/auth-routes/middleware/auth.js
Sébastien Chopin 17650c25e0 Middleware feature 🔥
2017-02-03 15:09:38 +01:00

11 lines
243 B
JavaScript

export default function ({ store, redirect, error }) {
// If user not connected, redirect to /
if (!store.state.authUser) {
// return redirect('/')
error({
message: 'You are not connected',
statusCode: 403
})
}
}