Redesign marketing pages and isolate public routes from app auth.

Give the landing, legal, and sign-in flows a consistent product shell while keeping marketing pages free of tRPC/session calls, fixing dev auth URL handling, and refreshing env and deploy docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 02:00:06 -04:00
co-authored by Cursor
parent 82977b6dd8
commit 6ec26a4a0d
36 changed files with 1743 additions and 819 deletions
+33 -10
View File
@@ -12,6 +12,7 @@ import superjson from "superjson";
import { ZodError } from "zod";
import { auth } from "~/lib/auth";
import { hasSessionCookie } from "~/lib/auth-server";
import { db } from "~/server/db";
import { getBearerToken, getUserForApiKey } from "~/server/api/api-keys";
@@ -47,17 +48,39 @@ export const createTRPCContext = async (opts: { headers: Headers }) => {
}
}
const session = await auth.api.getSession({
headers: opts.headers,
});
if (!hasSessionCookie(opts.headers)) {
return {
db,
session: null,
authSource: "none" as const,
apiKeyId: null,
...opts,
};
}
return {
db,
session,
authSource: session?.user ? ("session" as const) : ("none" as const),
apiKeyId: null,
...opts,
};
try {
const session = await auth.api.getSession({
headers: opts.headers,
});
return {
db,
session,
authSource: session?.user ? ("session" as const) : ("none" as const),
apiKeyId: null,
...opts,
};
} catch (error) {
console.error("[tRPC] Failed to resolve session:", error);
return {
db,
session: null,
authSource: "none" as const,
apiKeyId: null,
...opts,
};
}
};
/**