router icon indicating copy to clipboard operation
router copied to clipboard

SSR: throw redirect in beforeLoader does nothing

Open universse opened this issue 1 year ago • 0 comments

Describe the bug

Throw redirect in beforeLoader does not work for SSR example.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-u6w1y3?file=src%2Froutes%2F_auth.profile.tsx,src%2Froutes%2F_auth.tsx

Steps to Reproduce the Bug or Issue

  1. Add _auth.tsx with beforeLoader and _auth.profile.tsx.
  2. Click on Profile link, redirect is thrown and index route is loaded.
  3. Enter /profile route via address bar. User is not redirected to '/' route.
  • Need to open StackBlitz browser URL in a new tab since the URL in iframe does not get updated.

Expected behavior

User is redirected to '/' route.

Screenshots or Videos

No response

Platform

NA

Additional context

No response

universse avatar Jan 10 '24 07:01 universse