fix: include Referer header in API requests

This commit is contained in:
Sean Morley
2025-01-17 16:58:08 -05:00
parent 9ceee13edc
commit f4450b6a38
9 changed files with 23 additions and 10 deletions

View File

@@ -21,7 +21,8 @@ export const actions: Actions = {
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfToken,
Cookie: `csrftoken=${csrfToken}`
Cookie: `csrftoken=${csrfToken}`,
Referer: event.url.origin // Include Referer header
},
body: JSON.stringify({
email

View File

@@ -35,7 +35,8 @@ export const actions: Actions = {
headers: {
'Content-Type': 'application/json',
Cookie: `csrftoken=${csrfToken}`,
'X-CSRFToken': csrfToken
'X-CSRFToken': csrfToken,
Referer: event.url.origin // Include Referer header
},
method: 'POST',
credentials: 'include',