JiriChara / vue-kindergarten

Modular security for Vue, Vuex, Vue-Router and Nuxt
MIT License
312 stars 24 forks source link

Error in nuxt example? #33

Open aldarund opened 6 years ago

aldarund commented 6 years ago

Example says:

const options = isServer ? routeRecord.components.default : routeRecord.components.default.options;

Im not sure what this check is supposed to do, but with it server side checking dont work. It just get a wrong variable. So the first load of protected routes will always work even if its not allowed. If i change it just to

const options = routeRecord.components.default.options

All works as expected

JiriChara commented 6 years ago

Hi @aldarund,

big thanks for letting me know! I think they have change it in the new version of Nuxt.js. I will update the README.

Nayir commented 6 years ago

Hi,

I've an error with const options = routeRecord.components.default.options

Then I used const options = isServer ? routeRecord.components.default : routeRecord.components.default.options;

And it's working again.

Moreover, you let : const { route, error, redirect, store, isServer } = context But error and isServer are not used anymore with your last update on the NuxtJs example. Maybe you can check this ?

Thanks a lot for making this great tools, I'm excited to use it !

JiriChara commented 6 years ago

@Nayir thanks for reporting this to me. I will try to update the Nuxt example so it works for all versions of Nuxt.