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 work with direct url #1537

Closed
tkimvu opened this issue Apr 30, 2024 · 2 comments
Closed

Redirect not work with direct url #1537

tkimvu opened this issue Apr 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tkimvu
Copy link

tkimvu commented Apr 30, 2024

Describe the bug

In latest authenticated-routes example. When click to dashboard link from index, that work. But if write direct url like http://localhost:3001/dashboard => url redirect to http://localhost:3001/login?redirect=%2Fdashboard BUT auth layout loaded with isAuthenticated: false

Your Example Website or App

https://github.com/tanstack/router/tree/main/examples/react/authenticated-routes

Steps to Reproduce the Bug or Issue

Clone and open

Expected behavior

I want throw redirect to login

Screenshots or Videos

Screenshot from 2024-04-30 18-19-44

Platform

  • OS: [Linux]
  • Browser: [Chrome, Firefox]

Additional context

No response

@SeanCassiere
Copy link
Contributor

For better context;

The redirect thrown in the beforeLoad callback in the _auth.tsx layout route, isn't correctly being resolving the redirect when you directly visit the URL (for example to /dashboard).

@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

2 participants