diff --git a/.env.template b/.env.template index 92de521fa..794457eb7 100644 --- a/.env.template +++ b/.env.template @@ -24,5 +24,6 @@ NEXT_PUBLIC_SALEOR_CHANNEL= NEXT_PUBLIC_VENDURE_SHOP_API_URL= NEXT_PUBLIC_VENDURE_LOCAL_URL= -NEXT_PUBLIC_ORDERCLOUD_CLIENT_ID= +ORDERCLOUD_CLIENT_ID= +ORDERCLOUD_CLIENT_SECRET= STRIPE_SECRET= diff --git a/framework/ordercloud/api/utils/fetch-rest.ts b/framework/ordercloud/api/utils/fetch-rest.ts index c8b4c678e..f355174e9 100644 --- a/framework/ordercloud/api/utils/fetch-rest.ts +++ b/framework/ordercloud/api/utils/fetch-rest.ts @@ -16,7 +16,7 @@ async function getToken(baseUrl: string) { 'Content-Type': 'application/x-www-form-urlencoded', Accept: 'application/json', }, - body: `client_id=${process.env.NEXT_PUBLIC_ORDERCLOUD_CLIENT_ID}&grant_type=client_credentials`, + body: `client_id=${process.env.ORDERCLOUD_CLIENT_ID}&client_secret=${process.env.ORDERCLOUD_CLIENT_SECRET}&grant_type=client_credentials`, }) // If something failed getting the auth response @@ -94,8 +94,6 @@ export async function fetchData( return fetchData(opts, retries + 1) } - console.log('dataResponse.text:', await dataResponse.textConverted()); - // Get the body of it const error = await dataResponse.json()