diff --git a/app/layout.tsx b/app/layout.tsx index b09f9e7..224a250 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -24,7 +24,7 @@ export const metadata: Metadata = { }, description: "PodcastYes is an all-in-one AI platform that writes your script, records realistic multi-voice audio, and designs cover art — turning a topic into a finished episode in minutes.", - metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000"), + metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"), openGraph: { title: "PodcastYes", description: "Create scripted, narrated, illustrated podcasts with AI — no recording gear required.", diff --git a/lib/ai/pipeline/generate-episode.ts b/lib/ai/pipeline/generate-episode.ts index b84f136..da11760 100644 --- a/lib/ai/pipeline/generate-episode.ts +++ b/lib/ai/pipeline/generate-episode.ts @@ -261,7 +261,7 @@ async function generateArt(episode: EpisodeWithRelations) { } async function notifyReady(episode: EpisodeWithRelations) { - const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000"; + const appUrl = process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"; try { await sendEmail({ to: episode.user.email, diff --git a/lib/auth/auth-client.ts b/lib/auth/auth-client.ts index 8713375..f408cb0 100644 --- a/lib/auth/auth-client.ts +++ b/lib/auth/auth-client.ts @@ -4,7 +4,7 @@ import { createAuthClient } from "better-auth/react"; import { adminClient, organizationClient } from "better-auth/client/plugins"; export const authClient = createAuthClient({ - baseURL: process.env.NEXT_PUBLIC_APP_URL ?? undefined, + baseURL: process.env.NEXT_PUBLIC_APP_URL || undefined, plugins: [adminClient(), organizationClient()], }); diff --git a/lib/auth/auth.ts b/lib/auth/auth.ts index 061c64e..5dda84e 100644 --- a/lib/auth/auth.ts +++ b/lib/auth/auth.ts @@ -5,7 +5,7 @@ import { nextCookies } from "better-auth/next-js"; import { prisma } from "@/lib/db"; import { sendEmail, emailLayout } from "@/lib/email"; -const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000"; +const appUrl = process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"; const googleConfigured = !!(process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET); diff --git a/lib/billing/paypal.ts b/lib/billing/paypal.ts index 8aa086b..1270b51 100644 --- a/lib/billing/paypal.ts +++ b/lib/billing/paypal.ts @@ -2,7 +2,7 @@ import type { PlanKey } from "./plans"; const SANDBOX_BASE = "https://api-m.sandbox.paypal.com"; const base = () => process.env.PAYPAL_API_BASE ?? SANDBOX_BASE; -const appUrl = () => process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000"; +const appUrl = () => process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"; // Loudly warn (but don't throw — never break deploys) if PayPal is pointed at the // sandbox while running in production. The sandbox default is fine for dev. diff --git a/lib/billing/stripe.ts b/lib/billing/stripe.ts index f9f2cd6..c6c8292 100644 --- a/lib/billing/stripe.ts +++ b/lib/billing/stripe.ts @@ -18,7 +18,7 @@ export function isStripeConfigured(): boolean { return !!process.env.STRIPE_SECRET_KEY; } -const appUrl = () => process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000"; +const appUrl = () => process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"; /** Find-or-create the Stripe customer for a user and persist the id. */ export async function ensureStripeCustomer(user: {