Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot return to logged out experience once using Multipass URL #85

Open
BARK-AHAAS opened this issue Apr 26, 2024 · 6 comments
Open

Cannot return to logged out experience once using Multipass URL #85

BARK-AHAAS opened this issue Apr 26, 2024 · 6 comments
Labels
Bug Something isn't working

Comments

@BARK-AHAAS
Copy link

What area is the issue related to?

Checkout Sheet Kit

What version of @shopify/checkout-sheet-kit are you using?

2.0.1

Do you have a minimum reproducible example?

No response

Steps to Reproduce

  1. Open the checkout sheet using a Multipass URL with a return_to set to the checkoutURL.
  2. Confirm you are getting the logged in experience of saved addresses and email
  3. Close checkout sheet
  4. Open checkout sheet using generic checkoutURL (no multipass)

Expected Behavior

It would be expected that the logged out experience would be shown with no saved data from the previously logged in user

Actual Behavior

The previously used multipass session is still active and displaying the saved customer's information in checkout even though they are logged out in the app and a general checkoutURL was used.

Screenshots/Videos/Log output

No response

Storefront domain

No response

@BARK-AHAAS BARK-AHAAS added the Bug Something isn't working label Apr 26, 2024
@markmur
Copy link
Contributor

markmur commented Apr 26, 2024

Hey @BARK-AHAAS, the logged in state will persist across webviews because of auth cookies that are set on page load.

We don't currently offer a way to hook into the native webviews in the React Native implementation to delete the cookies, but you could try manually clearing them on close using https://github.com/react-native-cookies/cookies/tree/master?tab=readme-ov-file#webkit-support-ios-only

import CookieManager from '@react-native-cookies/cookies';

// CheckoutSheetKit uses WKWebView in swift, so you will want to set this to true
const useWebKit = true;

CookieManager.clearAll(useWebKit)
    .then((success) => {
        // done
    });

@BARK-AHAAS
Copy link
Author

Thank you @markmur - I will give that a shot. This question is a little out of scope of checkout-sheet but if i dont want to remove ALL cookies but instead only the one(s) responsible for logging out the customer do you happen to know which ones those are?

@markmur
Copy link
Contributor

markmur commented Apr 29, 2024

Can you say more about your use-case here @BARK-AHAAS?

Are users unable to log out from the logged in view? or do you want to control the identity state here when a user logs out from your app?

@BARK-AHAAS
Copy link
Author

The original use case is to log out of the logged in view. Since authentication is not handed through the Webview, when i log out of the user session in the native app and go into checkout it still is logged in due to the cookies still saved in the Webview itself (as you noted correctly in your response).

The new "issue" is that by using CookieManager.clearAll it is removing other cookies, not necessarily tied to the user session. The main issue this highlighted was all our non-production sites are password protected and we "authenticate" those webviews using the storefront password on app load so that we can run QA/testing on them smoothly, but now when we are testing logout and go to checkout the webview "reset" so requires a storefront password.

I am not saying this is a blocker as we could add logic to re-authenticate the password protected webview on Logout but just figured if we could be more explicit with removing only the user auth related cookie(s) then it would make the solution for this smoother on our end. Totally understand this is out of the scope of this library so no worries if we want to just close this issue and I will look for other solutions.

@github-actions github-actions bot added the stale label Jul 23, 2024
@github-actions github-actions bot removed the stale label Jul 24, 2024
@Shopify Shopify deleted a comment from github-actions bot Aug 21, 2024
@github-actions github-actions bot added the stale label Sep 21, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
@markmur markmur reopened this Sep 30, 2024
@markmur markmur removed the stale label Sep 30, 2024
@github-actions github-actions bot added the stale label Oct 31, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
@markmur markmur reopened this Nov 8, 2024
@Shopify Shopify deleted a comment from github-actions bot Nov 8, 2024
@Shopify Shopify deleted a comment from github-actions bot Nov 8, 2024
@Shopify Shopify deleted a comment from github-actions bot Nov 8, 2024
@Shopify Shopify deleted a comment from github-actions bot Nov 8, 2024
@markmur markmur removed the stale label Nov 8, 2024
@github-actions github-actions bot added the stale label Dec 9, 2024
@markmur markmur removed the stale label Dec 9, 2024
@Shopify Shopify deleted a comment from github-actions bot Dec 9, 2024
Copy link

github-actions bot commented Jan 9, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in 30 days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 9, 2025
@kiftio kiftio removed the stale label Jan 9, 2025
@kiftio
Copy link
Contributor

kiftio commented Jan 9, 2025

not stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants