I would like to use vue-auth together with nuxt js. But i need to configure vue-auth after vue router is set.
vue-auth setup code from https://github.com/websanova/vue-auth#install-2x
Vue.use(require('@websanova/vue-auth'), {
auth: require('@websanova/vue-auth/drivers/auth/bearer.js'),
http: require('@websanova/vue-auth/drivers/http/vue-resource.1.x.js'),
router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'),
...
rolesVar: 'type'
...
});
I tried doing this in the ~/plugins
directory and i get a vue-auth error:
Error (@websanova/vue-auth): vue-router.2.x.js : Vue.router must be set.