Skip to content

Commit

Permalink
feat(dbAuth): Lax SameSite cookie policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jan 9, 2025
1 parent f66ca2e commit 35120d2
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development',

// If you need to allow other domains (besides the api side) access to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development',

// If you need to allow other domains (besides the api side) access to
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/api/src/functions/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development',

// If you need to allow other domains (besides the api side) access to
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/auth/dbauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ cookie: {
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: true,
// Domain: 'example.com',
},
Expand Down Expand Up @@ -360,7 +360,7 @@ cookie: {
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development' ? true : false,
// highlight-next-line
Domain: 'example.com'
Expand Down Expand Up @@ -564,7 +564,7 @@ export const handler = async (event, context) => {
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development' ? true : false,
},
},
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cors.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const authHandler = new DbAuthHandler(event, context, {
cookie: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: true,
},
forgotPassword: forgotPasswordOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2568,7 +2568,7 @@ describe('dbAuth', () => {
attributes: {
Path: '/',
HttpOnly: true,
SameSite: 'Strict',
SameSite: 'Lax',
Secure: true,
Domain: 'example.com',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ describe('dbAuth', () => {
attributes: {
Path: '/',
HttpOnly: true,
SameSite: 'Strict',
SameSite: 'Lax',
Secure: true,
Domain: 'example.com',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development',

// If you need to allow other domains (besides the api side) access to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development' ? true : false,

// If you need to allow other domains (besides the api side) access to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development' ? true : false,

// If you need to allow other domains (besides the api side) access to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const handler = async (
attributes: {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
SameSite: 'Lax',
Secure: process.env.NODE_ENV !== 'development' ? true : false,

// If you need to allow other domains (besides the api side) access to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ test('Retrieving request details in a', async ({ page }) => {
expires: Math.floor(Date.now() / 1000) + 300, // 5 minutes from now in seconds
secure: true,
httpOnly: true,
sameSite: 'Strict',
sameSite: 'Lax',
},
])

Expand Down

0 comments on commit 35120d2

Please sign in to comment.