Commit 4bd38aa
[site] Fix preview login redirects (#28555)
## Summary
- Normalize post-login redirect targets against the active Vite/router
basename.
- Prevent UI preview links from redirecting to duplicated paths like
`/preview/pr-28544/preview/pr-28544/`.
- Preserve the existing full-page redirect behavior for `/ops` paths,
including preview ops paths.
## Testing
- `yarn workspace @lightsparkdev/site exec vitest run
src/hooks/loginRedirect.test.ts`
- `yarn workspace @lightsparkdev/site exec eslint
src/hooks/useLoginAndRedirect.tsx src/hooks/loginRedirect.ts
src/hooks/loginRedirect.test.ts`
- `yarn workspace @lightsparkdev/site exec prettier --check
src/hooks/useLoginAndRedirect.tsx src/hooks/loginRedirect.ts
src/hooks/loginRedirect.test.ts`
## Notes
- Full `@lightsparkdev/site` typecheck is blocked locally by existing
unresolved workspace package exports such as `@lightsparkdev/ui/router`.
GitOrigin-RevId: d0319351285faf26145bf5d920525218a47fbcad1 parent 779ce90 commit 4bd38aa
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
0 commit comments