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

passing customer login to checkout fix #1719

Merged
merged 15 commits into from Feb 8, 2024
Merged

Conversation

michenly
Copy link
Contributor

@michenly michenly commented Jan 31, 2024

WHY are these changes introduced?

A bug was found where the logged-in customer status is not passed to checkout. This is because the customer access token from Customer Account API cannot be passed to storefront API as buyer identify.

WHAT is this pull request doing?

In skeleton

HOW to test your changes?

  1. link a shop to skeleton to use customer account api
  2. login to customer account
  3. add an product before or after the login
  4. go to cart >> checkout
  5. see customer information being pre-filled on the checkout page
  6. logout on the checkout page
  7. go back to the hydrogen site and click on Account
  8. see the Account page redirecting you to shopify login page
  9. go back to the hydrogen site and see the menu item is now "Login in" instead of "Account"

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@michenly michenly self-assigned this Jan 31, 2024
@michenly michenly force-pushed the mc-checkout-customer-login-fix branch from bc7c7c6 to c404511 Compare January 31, 2024 19:58
@michenly michenly changed the title Mc checkout customer login fix passing customer login to checkout fix Jan 31, 2024
@michenly michenly marked this pull request as ready for review February 6, 2024 18:19
@michenly michenly requested review from a team and wizardlyhel February 6, 2024 18:20
Comment on lines 13 to 17
const {nonce, header, NonceProvider} = createContentSecurityPolicy({
connectSrc: [
'wss://<your-ngrok-domain.app:*', // Change with your ngrok domain
],
});
Copy link
Contributor Author

@michenly michenly Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this in the code feels really strange since it is only for development and only relevant if you are doing anything customer account related. Can I remove it?

Copy link
Contributor Author

@michenly michenly Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make it so you put in the domain during npm run dev --ngrok-domain=accepted-shrimp-privately.ngrok-free.app

this will automatically start ngrok for you, do the domain change and change dev up message too.

it will mean that our shopify hydrogen dev will depend on ngrok. Lets discuss in a separate PR since its outside of the scope of the current task

@michenly michenly force-pushed the mc-checkout-customer-login-fix branch from c132b71 to d6f3e35 Compare February 7, 2024 15:30
@michenly michenly force-pushed the mc-checkout-customer-login-fix branch from d6f3e35 to a4b4c17 Compare February 7, 2024 15:35
@michenly michenly force-pushed the mc-checkout-customer-login-fix branch 2 times, most recently from e43024d to f8d061e Compare February 7, 2024 16:17
@michenly michenly force-pushed the mc-checkout-customer-login-fix branch 2 times, most recently from 359e413 to b08574e Compare February 7, 2024 16:22
@michenly michenly force-pushed the mc-checkout-customer-login-fix branch from b08574e to 1c9072a Compare February 7, 2024 16:24
@michenly michenly force-pushed the mc-checkout-customer-login-fix branch from 1c9072a to 64466bb Compare February 7, 2024 16:31
@michenly michenly merged commit c0ec771 into main Feb 8, 2024
10 checks passed
@michenly michenly deleted the mc-checkout-customer-login-fix branch February 8, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants