Skip to content

Commit

Permalink
fix: updated cookies to use SameSite=Lax
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurency committed Nov 14, 2023
1 parent 29f3106 commit 915eef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/server/utils/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ export const checks = {
console.log('pkceChallenge', pkceChallenge)
res['code_challenge'] = pkceChallenge
res['code_challenge_method'] = 'S256'
setCookie(event, 'nuxt-auth-util-verifier', pkceVerifier, { maxAge: 60 * 15, secure: true, httpOnly: true })
setCookie(event, 'nuxt-auth-util-verifier', pkceVerifier, { maxAge: 60 * 15, secure: true, httpOnly: true, sameSite: 'lax' })
}
if (checks?.includes('state')) {
res['state'] = generateState()
setCookie(event, 'nuxt-auth-util-state', res['state'], { maxAge: 60 * 15, secure: true, httpOnly: true })
setCookie(event, 'nuxt-auth-util-state', res['state'], { maxAge: 60 * 15, secure: true, httpOnly: true, sameSite: 'lax' })
}
return res
},
Expand Down

0 comments on commit 915eef6

Please sign in to comment.