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