Shopify / checkout-sheet-kit-react-native

Shopify's Checkout Sheet Kit for React Native - simplifying the process of adding checkout to your native apps.
https://shopify.dev/docs/custom-storefronts/mobile-apps
MIT License
30 stars 3 forks source link

Issue with persistent login #84

Closed koulomesh closed 2 months ago

koulomesh commented 4 months ago

While checking out from the cart, the process we follow is creating a multipass link in which the input is checkoutUrl from cart storefront graphql request. When we open that url inside the checkout sheet, it works fine. The cart gets associated with the checkout. But on subsequent loads, it asks for web login inside the sheet.

markmur commented 4 months ago

Hey @koulomesh, multipass tokens typically have a short TTL. Are you providing a TTL when you generate the access token?

It's likely that you will need to regenerate a new token if the first has expired. When you reload checkout, are you calling present with a checkout URL? or the multipass URL?

koulomesh commented 4 months ago

@markmur I am calling present with a new multipass url obtained from the same cart checkout Url.

markmur commented 4 months ago

See this documentation:

The multipass token is only valid for 15 minutes and each token can only be used once

koulomesh commented 4 months ago

This means, for 15 mins, i have to use the same multipass url? or i can use a new multipass url also generated from same cartUrl ?

markmur commented 4 months ago

This means that you have 15 mins to hit the multipass URL and once you do the token will expire. If your customers close the checkout and reopen it, you will likely need to recreate a new multipass URL to login.

If you're using preloading, the checkout view will be cached for 5 minutes, meaning it will maintain the state across opens/closes during that time. If not, you will need to regenerate the multipass URL each time you present.

koulomesh commented 4 months ago

I am doing the same, generating a new multipass URL everytime the user presents the checkout sheet. Still, the login issue persists. In one session, it is auto logged in, then again it shows website's login route before proceeding ahead.

markmur commented 4 months ago

@koulomesh an incident was resolved relating to multipass logouts. Can you still reproduce?

koulomesh commented 4 months ago

Yeah, it is working fine now. But sometimes, just empty screen shows up in the bottomsheet.

markmur commented 4 months ago

I suspect the checkout has failed to load in this case. Are you handling the error from the event listener?

Do you have any logs or videos you could share?

koulomesh commented 4 months ago

Well, its not happening everytime. And in the scenario where it happens, nothing gets logged from the error event listener.

markmur commented 2 months ago

Error handling has been greatly improved in 3.0.0. If there's a specific issue you're facing after upgrading, please open a new issue. Thanks