2

In using vue-auth for authorization management, I got an issue in missing param for named routes.

I have path structure like "parent/:param/children" with auth set to true. After directing to Login the redirect back would fail in saying "Missing param for named route.

How can I add the param to the redirection?

Thanks.

1 Answer 1

3

I can't exactly figure out your problem without some code, but maybe this will help you:

In my router.js, I have this route which takes :id as a parameter:

{
  path: '/trip/:id',
  name: 'trip-detail',
  component: TripView
}

To use this route, I use router-link like this:

<router-link :to="{ name: 'trip-detail', params: { id: post.id }}">

So with vue-auth, you can try to pass an object like this to redirect:

{
   name: 'name.of.your.route',
   params: { param: your.parameter }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.