Skip to content

Commit

Permalink
fix: stop redirect loop caused by TOKEN cookie not sent
Browse files Browse the repository at this point in the history
  • Loading branch information
SiCoe committed Oct 3, 2023
1 parent f051484 commit 03efeef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions authn/github.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function mainProcess(event, context, callback) {
} // Options
),
{
sameSite: 'strict',
sameSite: 'lax',
secure: true
}
)
Expand Down Expand Up @@ -164,7 +164,7 @@ function redirect(request, headers, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
}],
Expand All @@ -188,7 +188,7 @@ function unauthorized(body, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
}],
Expand Down
8 changes: 4 additions & 4 deletions authn/openid.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function mainProcess(event, context, callback) {
), {
path: '/',
maxAge: config.SESSION_DURATION,
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down Expand Up @@ -243,7 +243,7 @@ function mainProcess(event, context, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down Expand Up @@ -327,7 +327,7 @@ function redirect(request, headers, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down Expand Up @@ -381,7 +381,7 @@ function unauthorized(error, error_description, error_uri, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down
8 changes: 4 additions & 4 deletions authn/pkce.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function mainProcess(event, context, callback) {
path: '/',
httpOnly: true,
secure: true,
sameSite: 'strict',
sameSite: 'lax',
maxAge: parseInt(config.SESSION_DURATION)
})
},
Expand Down Expand Up @@ -242,7 +242,7 @@ function mainProcess(event, context, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down Expand Up @@ -341,7 +341,7 @@ function redirect(request, headers, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down Expand Up @@ -405,7 +405,7 @@ function unauthorized(error, error_description, error_uri, callback) {
"value" : cookie.serialize('TOKEN', '', {
path: '/',
expires: new Date(1970, 1, 1, 0, 0, 0, 0),
sameSite: 'strict',
sameSite: 'lax',
secure: true
})
},
Expand Down

0 comments on commit 03efeef

Please sign in to comment.