fix: allow unauthenticated access to /items/* with setup context
All checks were successful
CI / ci (push) Successful in 1m23s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 15s

Items accessed via ?setup= or ?share= query params are now treated as
public routes, preventing the auth redirect to /login.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 20:34:13 +02:00
parent 4b26a6c88e
commit 4c80e9aa3c

View File

@@ -126,13 +126,16 @@ function RootLayout() {
const currentThreadId = threadMatch ? Number(threadMatch.threadId) : null;
// Allow public routes through without auth
const searchParams = new URLSearchParams(location.search);
const isPublicRoute =
location.pathname === "/" ||
location.pathname.startsWith("/users/") ||
location.pathname.startsWith("/global-items") ||
location.pathname === "/setups" ||
location.pathname.startsWith("/setups/") ||
location.pathname === "/login";
location.pathname === "/login" ||
(location.pathname.startsWith("/items/") &&
(searchParams.has("setup") || searchParams.has("share")));
// FAB visibility: show on all authenticated, non-public routes
const isSetupsPage = !!matchRoute({ to: "/setups", fuzzy: true });