fix: SameSite=Lax for OAuth cookies to allow cross-site redirects

This commit is contained in:
emil
2026-05-15 01:28:24 +03:00
parent 2b57cba3bb
commit 5273518908
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ export const GET: APIRoute = async ({ url }) => {
const redirectUrl = `${vkOAuthConfig.authUrl}?${params.toString()}`;
const cookies = [
`${VERIFIER_COOKIE_NAME}=${encodeURIComponent(verifier)}; HttpOnly; SameSite=Strict; Max-Age=600; Path=/`,
`oauth_state=${encodeURIComponent(state)}; HttpOnly; SameSite=Strict; Max-Age=600; Path=/`,
`${VERIFIER_COOKIE_NAME}=${encodeURIComponent(verifier)}; HttpOnly; Secure; SameSite=Lax; Max-Age=600; Path=/`,
`oauth_state=${encodeURIComponent(state)}; HttpOnly; Secure; SameSite=Lax; Max-Age=600; Path=/`,
];
return new Response(null, {
+2 -2
View File
@@ -23,8 +23,8 @@ export const GET: APIRoute = async ({ url }) => {
const redirectUrl = `${yandexOAuthConfig.authUrl}?${params.toString()}`;
const cookies = [
`${VERIFIER_COOKIE_NAME}=${encodeURIComponent(verifier)}; HttpOnly; SameSite=Strict; Max-Age=600; Path=/`,
`oauth_state=${encodeURIComponent(state)}; HttpOnly; SameSite=Strict; Max-Age=600; Path=/`,
`${VERIFIER_COOKIE_NAME}=${encodeURIComponent(verifier)}; HttpOnly; Secure; SameSite=Lax; Max-Age=600; Path=/`,
`oauth_state=${encodeURIComponent(state)}; HttpOnly; Secure; SameSite=Lax; Max-Age=600; Path=/`,
];
return new Response(null, {