Skip to content

Commit

Permalink
fix(cookies): avoid specifying sameSite for local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Oct 18, 2020
1 parent 2c8c54a commit 2e4aa8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/whook-oauth2/src/services/authCookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ async function initAuthCookies({
httpOnly: true,
domain: ENV.DEV_MODE ? undefined : COOKIES.domain,
secure: !ENV.DEV_MODE,
sameSite: ENV.DEV_MODE ? 'none' : true,
...(ENV.DEV_MODE ? {} : { sameSite: true }),
...(data.access_token ? {} : { maxAge: 0 }),
}),
cookie.serialize('refresh_token', data.refresh_token || '', {
path: BASE_PATH + AUTH_API_PREFIX,
httpOnly: true,
domain: ENV.DEV_MODE ? undefined : COOKIES.domain,
secure: !ENV.DEV_MODE,
sameSite: ENV.DEV_MODE ? 'none' : true,
...(ENV.DEV_MODE ? {} : { sameSite: true }),
...(session ? {} : { maxAge: Math.round(ms('100y') / 1000) }),
}),
];
Expand Down

0 comments on commit 2e4aa8d

Please sign in to comment.