mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
saleor: fix the session handling
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
||||
import { Customer } from '@commerce/types'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import { getCustomerQuery, getCSRFToken } from '../utils'
|
||||
import { getCustomerQuery } from '../utils'
|
||||
|
||||
export default useCustomer as UseCustomer<typeof handler>
|
||||
|
||||
@@ -12,9 +12,9 @@ export const handler: SWRHook<Customer | null> = {
|
||||
async fetcher({ options, fetch }) {
|
||||
const data = await fetch<any | null>({
|
||||
...options,
|
||||
variables: { customerAccessToken: getCSRFToken() },
|
||||
variables: {},
|
||||
})
|
||||
return data.customer ?? null
|
||||
return data.me ?? null
|
||||
},
|
||||
useHook: ({ useData }) => (input) => {
|
||||
return useData({
|
||||
|
Reference in New Issue
Block a user