Skip to content

beforeEach guard not changing URL after user uses back button #1850

@dserranog1

Description

@dserranog1

Reproduction

https://codesandbox.io/s/epic-dew-cgwffy

Steps to reproduce the bug

  1. Click on login
  2. Click on logout
  3. Click on the browser back button

Expected behavior

After the router intercepts the route, the new URL should be the one I am returning on the beforEach callback.

Actual behavior

The URL is staying as the one it was redirected from.

Additional information

In my actual app, no matter how many times I hit the back button, the URL stays on the route that the router redirected from i.e. the from.fullPath from the beforeEach guard.

I am using version 4.2.1 on my app.
It seems it's the same as #916, and the temporal fix also works in this case. The implemented fix (#921) however, doesn't to solve my situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas PRThis issue has already a PR with pending reviewshas workaroundA workaround has been found to deal with the issue

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions