1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-02 19:55:18 +02:00

fix: include Referer header and ensure CSRF token is set in request headers

This commit is contained in:
Sean Morley 2025-01-13 19:47:19 -05:00
parent a8e84be28e
commit 96ff727b57

View file

@ -37,8 +37,9 @@ export const actions: Actions = {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
Cookie: `sessionid=${sessionId}; csrftoken=${csrfToken}`,
'X-CSRFToken': csrfToken
'X-CSRFToken': csrfToken, // Ensure CSRF token is in header
Referer: event.url.origin, // Include Referer header
Cookie: `sessionid=${sessionId}; csrftoken=${csrfToken}`
},
credentials: 'include'
});
@ -59,8 +60,6 @@ export const actions: Actions = {
cookieDomain = undefined; // Do not set the domain
}
console.log('Deleting sessionid cookie with domain:', cookieDomain);
// Delete the session cookie
event.cookies.delete('sessionid', {
path: '/',