mirror of
https://github.com/vercel/commerce.git
synced 2025-06-13 11:21:22 +00:00
fix get-logged-in-customer BigCommerce
This commit is contained in:
parent
0661faced9
commit
035334a439
@ -34,7 +34,7 @@ const getLoggedInCustomer: CustomerEndpoint['handlers']['getLoggedInCustomer'] =
|
|||||||
getLoggedInCustomerQuery,
|
getLoggedInCustomerQuery,
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
'Set-Cookie': `${config.customerCookie}=${token}`,
|
cookie: `${config.customerCookie}=${token}`,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const { customer } = data
|
const { customer } = data
|
||||||
|
@ -7,7 +7,7 @@ const fetchGraphqlApi: (getConfig: () => BigcommerceConfig) => GraphQLFetcher =
|
|||||||
async (
|
async (
|
||||||
query: string,
|
query: string,
|
||||||
{ variables, preview } = {},
|
{ variables, preview } = {},
|
||||||
options: { headers?: HeadersInit } = {}
|
headers: HeadersInit = {}
|
||||||
): Promise<any> => {
|
): Promise<any> => {
|
||||||
// log.warn(query)
|
// log.warn(query)
|
||||||
const config = getConfig()
|
const config = getConfig()
|
||||||
@ -16,7 +16,7 @@ const fetchGraphqlApi: (getConfig: () => BigcommerceConfig) => GraphQLFetcher =
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${config.apiToken}`,
|
Authorization: `Bearer ${config.apiToken}`,
|
||||||
...options.headers,
|
...headers,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user