Nuxt.js: Use with vue-auth. Need access to router

Created on 3 Jan 2017  路  5Comments  路  Source: nuxt/nuxt.js

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.

This question is available on Nuxt.js community (#c81)
question

All 5 comments

Hi @scottgrayson

Sadly, nuxt.js is not compatible with vue-auth, but using JWT with Nuxt.js and the upcoming middleware feature will be really easy to do.

@Atinux Awesome! Can't wait to see the docs!

The documentation should be release today, think about checking our Twitter for the announcement :)

there is no middleware yet, what's the play we need JWT auth

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

o-alexandrov picture o-alexandrov  路  3Comments

danieloprado picture danieloprado  路  3Comments

uptownhr picture uptownhr  路  3Comments

surmon-china picture surmon-china  路  3Comments

gary149 picture gary149  路  3Comments