mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-03 20:25:18 +02:00
fix: include Referer header and ensure CSRF token is set in request headers
This commit is contained in:
parent
a8e84be28e
commit
96ff727b57
1 changed files with 3 additions and 4 deletions
|
@ -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: '/',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue