mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 19:55:18 +02:00
fix: include Referer header in user-related API requests
This commit is contained in:
parent
75162bbf7b
commit
1a7643b8a7
1 changed files with 6 additions and 1 deletions
|
@ -107,7 +107,8 @@ export const actions: Actions = {
|
|||
|
||||
const resCurrent = await fetch(`${endpoint}/auth/user-metadata/`, {
|
||||
headers: {
|
||||
Cookie: `sessionid=${sessionId}`
|
||||
Cookie: `sessionid=${sessionId}`,
|
||||
Referer: event.url.origin // Include Referer header
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -158,6 +159,7 @@ export const actions: Actions = {
|
|||
let res = await fetch(`${endpoint}/auth/update-user/`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
Referer: event.url.origin, // Include Referer header
|
||||
Cookie: `sessionid=${sessionId}; csrftoken=${csrfToken}`,
|
||||
'X-CSRFToken': csrfToken
|
||||
},
|
||||
|
@ -209,6 +211,7 @@ export const actions: Actions = {
|
|||
let res = await fetch(`${endpoint}/_allauth/browser/v1/account/password/change`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Referer: event.url.origin, // Include Referer header
|
||||
Cookie: `sessionid=${sessionId}; csrftoken=${csrfToken}`,
|
||||
'X-CSRFToken': csrfToken,
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -226,6 +229,7 @@ export const actions: Actions = {
|
|||
let res = await fetch(`${endpoint}/_allauth/browser/v1/account/password/change`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Referer: event.url.origin, // Include Referer header
|
||||
Cookie: `sessionid=${sessionId}; csrftoken=${csrfToken}`,
|
||||
'X-CSRFToken': csrfToken,
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -258,6 +262,7 @@ export const actions: Actions = {
|
|||
let res = await fetch(`${endpoint}/auth/change-email/`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Referer: event.url.origin, // Include Referer header
|
||||
Cookie: `sessionid=${sessionId}; csrftoken=${csrfToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRFToken': csrfToken
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue