From 661d1f32757e6b62f5a933b33d0f3facafe0f887 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 25 Feb 2021 11:22:20 +0100 Subject: [PATCH] accounts/** --- .../src/pages/api/stripe/createCheckoutSession.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js index ad7e099e..8e7524d1 100644 --- a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js +++ b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js @@ -32,13 +32,16 @@ export default async (req, res) => { // For full details see https://stripe.com/docs/api/checkout/sessions/create try { const authorization = req.headers.authorization; // authorization header from request - const user = await got(`${process.env.SKYNET_DASHBOARD_URL}/user`, { headers: { authorization } }); + const user = await got("http://accounts:3000/user", { headers: { authorization } }); if (!user.stripeCustomerId) { const customer = await stripe.customers.create(); console.log(customer); - const user = await got.put(`/user`, { json: { stripeCustomerId } }); + const user = await got.put(`http://accounts:3000/user`, { + headers: { authorization }, + json: { stripeCustomerId }, + }); console.log(user); }