farmOS / farmOS-aggregator

A microservice application for aggregating data from multiple farmOS instances.
GNU General Public License v3.0
21 stars 10 forks source link

Fix vue router redirects #27

Closed paul121 closed 5 years ago

paul121 commented 5 years ago

Upgrading Vue seemed to break some of the router functionality. Specifically accessing the root url, it doesn't redirect to /login/ and after logging in doesn't redirect to /main/dashboard

paul121 commented 5 years ago

Moving this to the v1.1.0 milestone. I had already done the work to upgrade to vuetify 2.0, going to go ahead and include it now.

paul121 commented 5 years ago

I believe our issue is related to this: https://github.com/vuejs/vue-router/issues/2881#issuecomment-520554378

vue-router 3.1.0 introduced some changes in how router.push() works, and causes some problems if you don't catch the errors

paul121 commented 5 years ago

Might need to implement a fix like the following: https://github.com/yunity/karrot-frontend/commit/f4def66c620c42e29dd47a097c7dad1a4e10cd1f

paul121 commented 5 years ago

This will be fixed by upgrading the version of vue-class-component and vue-property-decorator. The component hooks for beforeRouteEnter and beforeRouteUpdate were not being called.

The solution to this issue is already implemented, but sent me on the right path to finding the problem. Good info here regarding Component Hooks: https://github.com/vuejs/vue-router/issues/1888