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:
parent
a8e84be28e
commit
96ff727b57
1 changed files with 3 additions and 4 deletions
|
@ -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: '/',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue