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,
undefined,
{
'Set-Cookie': `${config.customerCookie}=${token}`,
cookie: `${config.customerCookie}=${token}`,
}
)
const { customer } = data

View File

@ -7,7 +7,7 @@ const fetchGraphqlApi: (getConfig: () => BigcommerceConfig) => GraphQLFetcher =
async (
query: string,
{ variables, preview } = {},
options: { headers?: HeadersInit } = {}
headers: HeadersInit = {}
): Promise<any> => {
// log.warn(query)
const config = getConfig()
@ -16,7 +16,7 @@ const fetchGraphqlApi: (getConfig: () => BigcommerceConfig) => GraphQLFetcher =
method: 'POST',
headers: {
Authorization: `Bearer ${config.apiToken}`,
...options.headers,
...headers,
'Content-Type': 'application/json',
},
body: JSON.stringify({