fix(onboarding): preserve restored board login target

This commit is contained in:
Thomas Camlong committed 2026-08-14 02:11:43 +02:00
1 parent c224e62f30
commit 34a17932ae
2 files changed
+10 -2

No files matched your search

@@ -50,7 +50,13 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(
if (error instanceof TRPCError && error.code === "NOT_FOUND") {
if (!session) {
logger.debug("No home board found for anonymous user, redirecting to login");
redirect("/auth/login");
const requestedBoardName =
typeof resolvedParams.name === "string" ? `/boards/${encodeURIComponent(resolvedParams.name)}` : null;
redirect(
requestedBoardName
? `/auth/login?callbackUrl=${encodeURIComponent(requestedBoardName)}`
: "/auth/login",
);
}
notFound();