Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set beforeEnter in extendRoute #53

Closed
robheymann opened this issue May 17, 2021 · 2 comments
Closed

Set beforeEnter in extendRoute #53

robheymann opened this issue May 17, 2021 · 2 comments

Comments

@robheymann
Copy link

Hi,

Thanks for the great component.

I am new to vue and vite, and I am looking to set "route.beforeEnter: Auth0.routeGuard" in the Pages.extendRoute config in vite.config.ts (assuming this is the correct place for this)

Could you perhaps assist with how to get this done? Assume I need to access the RouteRecordRaw?

Many Thanks,
Rob

@hannoeru
Copy link
Owner

hannoeru commented May 17, 2021

extendRoute(route, parent) {
  if (route.path === 'somePath') {
    return {
      ...route,
      beforeEnter: Auth0.routeGuard
    }
  }
},

@robheymann
Copy link
Author

Thank you very much for the reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants