Skip to content

backport navigation guard return values #3796

Open
@1593292349

Description

What problem does this feature solve?

being able to return a value in a navigaiton guard:

router.beforeEach(to => {
  if (!user)
  return { name: 'login', query: { redirectTo: to.fullPath } }
})

### What does the proposed API look like?
Like v4. X

<!-- generated by vue-issues. DO NOT REMOVE -->

Metadata

Assignees

No one assigned

    Labels

    feature requestfixed on 4.xThis issue has been already fixed on the v4 but exists in v3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions