Skip to content

Commit

Permalink
fix: problem with custom app install not passing the cookies due to s…
Browse files Browse the repository at this point in the history
…ameSite=lax.

See this PR for other people who have ran into this issue
Shopify#905
  • Loading branch information
ryanray committed Jan 28, 2024
1 parent 51f3c27 commit fd96feb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/shopify-api/lib/auth/oauth/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ export function begin(config: ConfigInterface): OAuthBegin {

await cookies.setAndSign(STATE_COOKIE_NAME, state, {
expires: new Date(Date.now() + 60000),
sameSite: 'lax',
secure: true,
// hack necessary due to browsers not setting cookies with sameSite=lax
// https://github.com/Shopify/shopify-api-js/pull/905
sameSite: 'none',
secure: true, // needs to be true, especially when sameSite=none
path: callbackPath,
domain: config.cookieDomain || undefined,
});

const query = {
Expand Down

0 comments on commit fd96feb

Please sign in to comment.