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

Redirect not showing correct components but will append the correct URL #1541

Closed
jexodusmercado opened this issue May 1, 2024 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@jexodusmercado
Copy link

jexodusmercado commented May 1, 2024

Describe the bug

I am using the version 1.31.3 in my repository. Redirect is not working properly if I enter the URL directly inside instead of navigating thru UI. Sample authentication repo also has this bug.

Your Example Website or App

https://codesandbox.io/p/devbox/github/tanstack/router/tree/main/examples/react/authenticated-routes?embed=1&file=%2Fsrc%2Froutes%2F_auth.tsx%3A22%2C5&theme=light

Steps to Reproduce the Bug or Issue

  1. enter the /invoice url
  2. no error but will show the invoice components instead of the login

Expected behavior

As a user, I should be redirected to the correct screen. In this case, I am able to view the protected routes even if I am not yet authenticated.

Screenshots or Videos

No response

Platform

  • OS: Linux, Debian
  • Browser: Firefox 115.9.1esr
  • Version: 1.31.3 package version

Additional context

No response

@SeanCassiere SeanCassiere added the bug Something isn't working label May 1, 2024
@SeanCassiere
Copy link
Contributor

Same as #1537.

@jexodusmercado
Copy link
Author

I think this is also the same with #1528. Downgraded to 1.28.1 to make it work for now.

@tmkn
Copy link

tmkn commented May 1, 2024

Seems like an unfortunate time to checkout the project. I set it up yesterday, file base routing.
I have an / index route and a /login route and made it so that the index route always redirects to the login route via beforeLoad and throw redirect(...), just to try things and it just wouldn't work.

upon accessing the / route, the url shows /login but the displayed component is the one from the index route :(
Upon reloading (browser url shows /login) it only then shows the component for the /login route.

@tannerlinsley
Copy link
Collaborator

@tmkn Unfortunate indeed as I'm currently fixing this issue!

@tmkn
Copy link

tmkn commented May 1, 2024

@tannerlinsley all good, I saw you were working on it, updating to 1.31.4 fixed some of the issues like redirecting from /foo to /login.

I like the type safety of the routes and its not urgent to have it working, will most likely stick with it anyway once it's working, I like what I've seen so far :)

tannerlinsley added a commit that referenced this issue May 1, 2024
@SeanCassiere
Copy link
Contributor

Tanner has fixed this and it's available in 1.31.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants