Correctly add headers indicating this is a stencil cli request to /internalapi routes. This allows us, among other things, to properly set cookies in the browser from checkout when running on localhost.
Screenshots (if appropriate)
Before:
We can see cookies are incorrectly coming back with SameSite=None which isnt allowed here, so the cookies fail to persist in the browser and no login occurs. We can see internally that the incoming request in this case doesnt have the stencil-cli header.
After:
We can see that due to now propagating the header the cookies correctly have empty SameSite attribute and persist to the browser allowing login.
What?
Correctly add headers indicating this is a stencil cli request to /internalapi routes. This allows us, among other things, to properly set cookies in the browser from checkout when running on localhost.
Screenshots (if appropriate)
Before:
We can see cookies are incorrectly coming back with
SameSite=None
which isnt allowed here, so the cookies fail to persist in the browser and no login occurs. We can see internally that the incoming request in this case doesnt have thestencil-cli
header.After:
We can see that due to now propagating the header the cookies correctly have empty
SameSite
attribute and persist to the browser allowing login.cc @bigcommerce/storefront-team