JiriChara / vue-kindergarten

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

Redirecting before child resolve #26

Closed paulodfreitas closed 7 years ago

paulodfreitas commented 7 years ago

I'm trying to use Vue-Kindergarten in an application with Nuxt.js. But when trying to control which routes(screens) open I cannot use an url to directly open a screen, because when my Perimeter executes to validate the access of the current child, she is not fully resolved and return a undefined value, so my perimeter return false, then the RouteGoverness redirects to my home page, just like a not logged user would need.

Note: I get no problems when navigating through my system with normal links, just with a direct url to specific screens.

Is there something I am missing?

Thanks. Great project.

JiriChara commented 7 years ago

Hey @paulodfreitas,

sorry for a late reply. I think the problem is that your user is not initialized on the server. I think you need to call nuxtServerInit method and init the user first (see: https://nuxtjs.org/guide/vuex-store/#the-nuxtserverinit-action)

JiriChara commented 7 years ago

Hey @paulodfreitas, did you manage to fix that issue?

paulodfreitas commented 7 years ago

Hey @JiriChara ,

sorry about not answering before. Yep indeed that, not have a user initialized on server, was the root of this issue. I am actually learning Vue, Vuex and Nuxt, so I did not give a feedback before because I still don't know how to solve my issue, but it's no longer a problem of this project.

Extra info: My app data and session is currently stored in firebase and no data is stored in my server : (

Thank you for attention.