fix: tolerate empty NEXT_PUBLIC_APP_URL during production build
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user