Nuxt/examples/auth-jwt/middleware/notAuthenticated.js
Junya Kono 7161c6f191 Add JWT example source code (#3746)
* Add JWT exmaple source code

* add sample code

* [fix] eslint

* Update index.js

* [fix] rename middleware\ / to middleware/

* Add default value for demo
2018-08-17 07:49:06 +02:00

7 lines
161 B
JavaScript

export default function ({ store, redirect }) {
// If the user is authenticated redirect to home page
if (store.state.auth) {
return redirect('/')
}
}