You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I'm implementing Auth0 authentication in Vue 3 using Vite for the first time. For now, creating the route manually, I can apply the "routeGuard" function in "beforeEnter" normally. The route is mounted correctly and the redirect works as it should.
The problem is when I apply the "vite-plugin-pages" auto-router, when I try to pass the "routeGuard" through the extendRoute in vite.config.ts (as described in Issue #53), my code stops working.
Debugging the code, looks like the routeGuard function is translated to string (instead of function), and breaks vue-router.
Am I doing something wrong? Or the way I'm calling the "routeGuard" function is wrong? Is it possible to define the "beforeEnter" for the routes in "router.ts" file or do I need to set through vite.config.ts?
Thanks!
The text was updated successfully, but these errors were encountered:
Currently you can't use beforeEnter in extendRoute, I don't think that will works too. maybe you should modify the routes that imported from virtual:generated-pages.
Hi.
In my project I'm implementing Auth0 authentication in Vue 3 using Vite for the first time. For now, creating the route manually, I can apply the "routeGuard" function in "beforeEnter" normally. The route is mounted correctly and the redirect works as it should.
The problem is when I apply the "vite-plugin-pages" auto-router, when I try to pass the "routeGuard" through the extendRoute in vite.config.ts (as described in Issue #53), my code stops working.
Debugging the code, looks like the routeGuard function is translated to string (instead of function), and breaks vue-router.
Am I doing something wrong? Or the way I'm calling the "routeGuard" function is wrong? Is it possible to define the "beforeEnter" for the routes in "router.ts" file or do I need to set through vite.config.ts?
Thanks!
The text was updated successfully, but these errors were encountered: