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

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

Open
dserranog1 opened this issue May 19, 2023 · 4 comments · May be fixed by #2133
Open

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

dserranog1 opened this issue May 19, 2023 · 4 comments · May be fixed by #2133
Labels
bug Something isn't working has PR This issue has already a PR with pending reviews has workaround A workaround has been found to deal with the issue

Comments

@dserranog1
Copy link

dserranog1 commented May 19, 2023

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.

Copy link
Member

posva commented May 19, 2023

You are being redirected to the Home page because that’s what you return in the navigation guard

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2023
@dserranog1
Copy link
Author

You are being redirected to the Home page because that’s what you return in the navigation guard

The component being rendered is Home, but the route is /about @posva

Selection_082

@codePassion-dot
Copy link

I'm having the exact same problem described in this issue. I don't understand why it was closed so soon

@posva
Copy link
Member

posva commented Feb 6, 2024

I opened #2133 with a workaround.

@posva posva added bug Something isn't working has PR This issue has already a PR with pending reviews has workaround A workaround has been found to deal with the issue labels Feb 6, 2024
@posva posva reopened this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has PR This issue has already a PR with pending reviews has workaround A workaround has been found to deal with the issue
Projects
Status: 📆 Planned
Development

Successfully merging a pull request may close this issue.

3 participants