Nuxt/examples/auth-routes/middleware/auth.js

11 lines
243 B
JavaScript
Raw Normal View History

2017-02-03 14:09:27 +00:00
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
})
}
}