Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I am creating a headless app using nuxt.js. I have sucessfully used graphql API to retrive prodicuts/collections etc, but now I need to create a login so that users can login and can view their orders.
I have a form set up, containing the email address and password fields, but not really sure how to proceed forwards.
How is this achieved using mutation in the grapql API? I can see their is a CustomerAccessToken object.
https://help.shopify.com/en/api/storefront-api/reference/object/customeraccesstoken
Thanks
Solved! Go to the solution
This is an accepted solution.
You can get a token by submitting that information to customerAccessTokenCreate
Docs: https://help.shopify.com/en/api/storefront-api/reference/mutation/customeraccesstokencreate
That token can be used to retrieve customer data, associate checkouts, etc
This is an accepted solution.
You can get a token by submitting that information to customerAccessTokenCreate
Docs: https://help.shopify.com/en/api/storefront-api/reference/mutation/customeraccesstokencreate
That token can be used to retrieve customer data, associate checkouts, etc
Thanks! Does this token also log the customer in? or does it simply provide a token which you can then pass to another mutation?
Using the token in queries/mutations *is* the session, store it client side.
can we implement JWT based on returned customerAccessToken ?
If possible, how to do this
Hi! Could yo expand that? The access token provided is not valid to log in the user, but only to perform mutations. Any alternative?
Did you find a solution? Same issue, the token is only useful for mutations.