mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Update ordercloud auth
This commit is contained in:
@@ -24,5 +24,6 @@ NEXT_PUBLIC_SALEOR_CHANNEL=
|
|||||||
NEXT_PUBLIC_VENDURE_SHOP_API_URL=
|
NEXT_PUBLIC_VENDURE_SHOP_API_URL=
|
||||||
NEXT_PUBLIC_VENDURE_LOCAL_URL=
|
NEXT_PUBLIC_VENDURE_LOCAL_URL=
|
||||||
|
|
||||||
NEXT_PUBLIC_ORDERCLOUD_CLIENT_ID=
|
ORDERCLOUD_CLIENT_ID=
|
||||||
|
ORDERCLOUD_CLIENT_SECRET=
|
||||||
STRIPE_SECRET=
|
STRIPE_SECRET=
|
||||||
|
@@ -16,7 +16,7 @@ async function getToken(baseUrl: string) {
|
|||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
Accept: 'application/json',
|
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
|
// If something failed getting the auth response
|
||||||
@@ -94,8 +94,6 @@ export async function fetchData<T>(
|
|||||||
return fetchData(opts, retries + 1)
|
return fetchData(opts, retries + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('dataResponse.text:', await dataResponse.textConverted());
|
|
||||||
|
|
||||||
// Get the body of it
|
// Get the body of it
|
||||||
const error = await dataResponse.json()
|
const error = await dataResponse.json()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user