Skip to content

Scheduling infrastructure for absolutely everyone.

Fixes customer portal return url (#802)

Omar Lópezf23e4f2b9d0c
diff --git a/ee/pages/api/integrations/stripepayment/portal.ts b/ee/pages/api/integrations/stripepayment/portal.ts
index 01d7b4d4e9b..fb47f42c070 100644
--- a/ee/pages/api/integrations/stripepayment/portal.ts
+++ b/ee/pages/api/integrations/stripepayment/portal.ts
@@ -48,7 +48,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
message: "Stripe customer id not found",
});
- const return_url = `${process.env.NEXT_PUBLIC_APP_URL}/settings/billing`;
+ const return_url = `${process.env.BASE_URL}/settings/billing`;
const stripeSession = await stripe.billingPortal.sessions.create({
customer: customer.id,
return_url,
diff --git a/environment.d.ts b/environment.d.ts
index 2ffddde23fe..c5a965c90d3 100644
--- a/environment.d.ts
+++ b/environment.d.ts
@@ -1,5 +1,30 @@
declare namespace NodeJS {
interface ProcessEnv {
readonly CALENDSO_ENCRYPTION_KEY: string | undefined;
+ readonly DATABASE_URL: string | undefined;
+ readonly GOOGLE_API_CREDENTIALS: string | undefined;
+ readonly BASE_URL: string | undefined;
+ readonly NEXT_PUBLIC_BASE_URL: string | undefined;
+ readonly NEXT_PUBLIC_APP_URL: string | undefined;
+ readonly JWT_SECRET: string | undefined;
+ readonly NEXT_PUBLIC_TELEMETRY_KEY: string | undefined;
+ readonly MS_GRAPH_CLIENT_ID: string | undefined;
+ readonly MS_GRAPH_CLIENT_SECRET: string | undefined;
+ readonly ZOOM_CLIENT_ID: string | undefined;
+ readonly ZOOM_CLIENT_SECRET: string | undefined;
+ readonly EMAIL_FROM: string | undefined;
+ readonly EMAIL_SERVER_HOST: string | undefined;
+ readonly EMAIL_SERVER_PORT: number | undefined;
+ readonly EMAIL_SERVER_USER: string | undefined;
+ readonly EMAIL_SERVER_PASSWORD: string | undefined;
+ readonly CRON_API_KEY: string | undefined;
+ readonly NEXT_PUBLIC_STRIPE_PUBLIC_KEY: string | undefined;
+ readonly STRIPE_PRIVATE_KEY: string | undefined;
+ readonly STRIPE_CLIENT_ID: string | undefined;
+ readonly STRIPE_WEBHOOK_SECRET: string | undefined;
+ readonly PAYMENT_FEE_PERCENTAGE: number | undefined;
+ readonly PAYMENT_FEE_FIXED: number | undefined;
+ readonly CALENDSO_ENCRYPTION_KEY: string | undefined;
+ readonly NEXT_PUBLIC_INTERCOM_APP_ID: string | undefined;
}
}
diff --git a/next.config.js b/next.config.js
index 07a33433e08..df446ac2f98 100644
--- a/next.config.js
+++ b/next.config.js
@@ -12,6 +12,7 @@ if (process.env.BASE_URL) {
if (!process.env.NEXT_PUBLIC_APP_URL) {
process.env.NEXT_PUBLIC_APP_URL = process.env.BASE_URL;
}
+process.env.NEXT_PUBLIC_BASE_URL = process.env.BASE_URL;
if (!process.env.EMAIL_FROM) {
console.warn(
diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx
index 8bc41acf91b..349fc9480a8 100644
--- a/pages/settings/billing.tsx
+++ b/pages/settings/billing.tsx
@@ -13,7 +13,9 @@ export default function Billing() {
<SettingsShell>
<div className="py-6 lg:pb-8 lg:col-span-9">
<div className="my-6">
- <form method="POST" action="/api/integrations/stripepayment/portal">
+ <form
+ method="POST"
+ action={`${process.env.NEXT_PUBLIC_BASE_URL}/api/integrations/stripepayment/portal`}>
<Button type="submit">Manage billing</Button>
</form>
</div>