Shopify / hydrogen

Hydrogen lets you build faster headless storefronts in less time, on Shopify.
https://hydrogen.shop
MIT License
1.45k stars 278 forks source link

Add optional headers param for logout redirect #2602

Closed coryagami closed 1 month ago

coryagami commented 1 month ago

WHY are these changes introduced?

This allows for passing Set-Cookie headers to the logout redirect, allowing users the possibility of clearing certain cookies (like the cart) on logout.

This is being used in our app to allow multiple users to share a login device without persisting carts across users.

WHAT is this pull request doing?

Passing through an optional headers param to the logout redirect call.

HOW to test your changes?

Added a new test to customer.test.ts to test this functionality.

Checklist

coryagami commented 1 month ago

Thanks for the contribution. Please include a changeset by running npm run changeset - choose patch update

Thanks @wizardlyhel! I added a patch changeset. For future reference, do we always need a changeset for the workflow to succeed anytime we make any changes in src/ ?

wizardlyhel commented 1 month ago

changeset is a must - It's how we can automatically attribute your contributions in our changelog CI workflow is something we have to evaluate your code first before approving it to run