diff --git a/apps/web/src/assets/styles/globals.css b/apps/web/src/assets/styles/globals.css index 2c1f546..aadca17 100644 --- a/apps/web/src/assets/styles/globals.css +++ b/apps/web/src/assets/styles/globals.css @@ -154,3 +154,13 @@ :root { color-scheme: dark; } + +/* Override the Tailwind default --font-sans / --font-mono CSS vars + (which BaseLayout used to populate from next/font/google Geist). + We self-host Anthropic Sans/Serif/Mono now — no Google Fonts fetch, + no CSP font-src violation. */ +.cm-root { + --font-sans: var(--cm-font-sans); + --font-mono: var(--cm-font-mono); + --font-serif: var(--cm-font-serif); +} diff --git a/apps/web/src/modules/billing/hooks/use-customer.ts b/apps/web/src/modules/billing/hooks/use-customer.ts index 6d6eccf..fdd7b6e 100644 --- a/apps/web/src/modules/billing/hooks/use-customer.ts +++ b/apps/web/src/modules/billing/hooks/use-customer.ts @@ -1,5 +1,17 @@ import { useQuery } from "@tanstack/react-query"; +import { authClient } from "~/lib/auth/client"; import { billing } from "~/modules/billing/lib/api"; -export const useCustomer = () => useQuery(billing.queries.customer.get); +/** + * Fetches the current user's billing customer. Gated on session + * presence so unauthenticated public pages (landing, /pricing) don't + * fire a 401 just to render plan cards. + */ +export const useCustomer = () => { + const { data: session } = authClient.useSession(); + return useQuery({ + ...billing.queries.customer.get, + enabled: !!session?.user, + }); +}; diff --git a/apps/web/src/modules/common/layout/base.tsx b/apps/web/src/modules/common/layout/base.tsx index b8e95e2..ce12058 100644 --- a/apps/web/src/modules/common/layout/base.tsx +++ b/apps/web/src/modules/common/layout/base.tsx @@ -1,22 +1,7 @@ -import { Geist_Mono, Geist } from "next/font/google"; - import { cn } from "@turbostarter/ui"; import { appConfig } from "~/config/app"; -const sans = Geist({ - subsets: ["latin"], - display: "swap", - variable: "--font-sans", -}); - -const mono = Geist_Mono({ - subsets: ["latin"], - display: "swap", - variable: "--font-mono", - weight: ["300", "400", "500"], -}); - interface BaseLayoutProps { readonly locale: string; readonly children: React.ReactNode; @@ -24,7 +9,7 @@ interface BaseLayoutProps { export const BaseLayout = ({ children, locale }: BaseLayoutProps) => { return ( - +