Checkout Login for Users logged in via Storefront API

Martin_Raedling
New Member
2 0 8

I'm building a custom Storefront using the Shopify Storefront API and all kinds of user-account specific stuff is also handled via the api (including login, account management etc.).

When checking out (= redirecting to the checkout webUrl) the user is understandably not logged in because he doesn't have any cookie set by a 'normal' login via shopify shop. The checkout is associated with the user already via  `checkoutCustomerAssociate` so the required information is already set, but on the Customer information page I still get the Login hint: 

Already have an account? Log in

Which is kind of odd because that links to the normal shopify-frontend which the user shouldn't use. Of couse I could redirect that to my custom login, but still I wouldn't be able to set the cookie. 

So there are 2 possible ways to handle this:

  • send the user access token return by the api with the redirect to the checkout
  • not show the login hint

I've already tried to hide the login hint via disabling Customer accounts through the Checkout Settings, but this also leads to disabling accounts at all which means registering through the api isn't possible anymore...

If one of the ways is actually possible I'd really appreciate if you could point me to the documentation about that. 

 

 

Replies 2 (2)
Jujuba
Shopify Partner
5 0 1

Hey, 

have you found a solution for this? I’m struggling with the same thing. 

BR

max-g
New Member
1 0 0

Hi, we are having the same issue.

We have our custom storefront hosted on ourdomain.com while the Shopify shop is on shop.ourdomain.com. I was wondering if there was a way to call an endpoint from our custom storefront to the Shopify shop with an authenticated user (user's logged in via the mutation, retrieved the access token) that would set a cookie that could be used afterward to "auto-login" the customer in Shopify web checkout ?

For now, what i'm thinking is that we will have to hide the "Already have an account, login" message from the web checkout using Shopify Plus (which our client is using, but meaning we might not have this avenue for other clients in the future) feature of being able to customize the checkout.