A
Alokai13mo ago
ALI

Sotring cookies for magento 2 using ```vsf-customer```

I have integrated Magento 2 sdk in my vsf app. For use Authentication, I am using
createCustomer
createCustomer
method with custom graphQL query and then I use
generateCustomerToken
generateCustomerToken
method to generate Token for authentication. Now, I want to store this token in cookies/localstorage. The documentation suggests that I should use
vsf-customer
vsf-customer
to store cookies because mthods like
customer, customerCart, updateCustomer, changeCustomerPassword
customer, customerCart, updateCustomer, changeCustomerPassword
use token stored in
vsf-customer
vsf-customer
. But, I haven't found any guide related to the usage of this method. Any help on it will be a huge helping hand for me. thanks
1 Reply
ALI
ALIOP13mo ago
Okay, there is this small portion in the documentation of customer method of magento sdk. which says that we can pass customHeaders like so:
const token = '123'

const customHeaders = { Authorization: `Bearer {token}` }


// fetch customer

const customer = await sdk.magento.customer({ customHeaders });
const token = '123'

const customHeaders = { Authorization: `Bearer {token}` }


// fetch customer

const customer = await sdk.magento.customer({ customHeaders });
but I would still like to see how can we use vsf-customer
Want results from more Discord servers?
Add your server