Update ordercloud auth

This commit is contained in:
goncy
2021-09-21 13:45:31 -03:00
parent 44b5ec9464
commit a18ec87c51
2 changed files with 3 additions and 4 deletions

View File

@@ -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=

View File

@@ -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<T>(
return fetchData(opts, retries + 1)
}
console.log('dataResponse.text:', await dataResponse.textConverted());
// Get the body of it
const error = await dataResponse.json()