fix(onboarding): preserve restored board login target

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-14 11:32:13 +02:00
1 parent 174e0a7606
commit fc66211dd2
2 files changed
+10 -2

No files matched your search

@@ -52,7 +52,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();
+3 -1
View File
@@ -21,7 +21,9 @@ export const Finish = ({ environment }: OnboardingStudioProps) => {
const primaryColor = environment.initialBoard?.primaryColor ?? "#fa5252";
const secondaryColor = environment.initialBoard?.secondaryColor ?? "#fd7e14";
const boardHref = `/boards/${encodeURIComponent(environment.initialBoard?.name ?? "dashboard")}`;
const destination = environment.canConfigurePrivileged ? boardHref : "/auth/login?callbackUrl=%2Finit";
const destination = environment.canConfigurePrivileged
? boardHref
: `/auth/login?callbackUrl=${encodeURIComponent(boardHref)}`;
const openBoard = (event: ReactMouseEvent<HTMLAnchorElement>) => {
sounds.success();
if (