fix get-logged-in-customer BigCommerce

This commit is contained in:
Lorenzo Stramaccia 2022-11-25 15:12:45 +01:00
parent 0661faced9
commit 035334a439
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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({