Add back missing authorization headers

pull/249/merge
Flashfyre 2024-04-24 19:26:04 -04:00
parent ad818aa314
commit 97218be59c
2 changed files with 5 additions and 5 deletions

View File

@ -272,7 +272,7 @@ export class GameData {
const systemData = JSON.stringify(data, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v);
if (!bypassLogin) {
Utils.apiPost(`savedata/update?datatype=${GameDataType.SYSTEM}`, systemData)
Utils.apiPost(`savedata/update?datatype=${GameDataType.SYSTEM}`, systemData, undefined, true)
.then(response => response.text())
.then(error => {
this.scene.ui.savingIcon.hide();
@ -551,7 +551,7 @@ export class GameData {
const sessionData = this.getSessionSaveData(scene);
if (!bypassLogin) {
Utils.apiPost(`savedata/update?datatype=${GameDataType.SESSION}&slot=${scene.sessionSlotId}`, JSON.stringify(sessionData))
Utils.apiPost(`savedata/update?datatype=${GameDataType.SESSION}&slot=${scene.sessionSlotId}`, JSON.stringify(sessionData), undefined, true)
.then(response => response.text())
.then(error => {
if (error) {
@ -752,7 +752,7 @@ export class GameData {
if (success !== null && !success)
return resolve([false, false]);
const sessionData = this.getSessionSaveData(scene);
Utils.apiPost(`savedata/clear?slot=${slotId}`, JSON.stringify(sessionData)).then(response => {
Utils.apiPost(`savedata/clear?slot=${slotId}`, JSON.stringify(sessionData), undefined, true).then(response => {
if (response.ok)
loggedInUser.lastSessionSlot = -1;
return response.json();
@ -912,7 +912,7 @@ export class GameData {
updateUserInfo().then(success => {
if (!success)
return displayError(`Could not contact the server. Your ${dataName} data could not be imported.`);
Utils.apiPost(`savedata/update?datatype=${dataType}${dataType === GameDataType.SESSION ? `&slot=${slotId}` : ''}`, dataStr)
Utils.apiPost(`savedata/update?datatype=${dataType}${dataType === GameDataType.SESSION ? `&slot=${slotId}` : ''}`, dataStr, undefined, true)
.then(response => response.text())
.then(error => {
if (error) {

View File

@ -307,7 +307,7 @@ export default class MenuUiHandler extends MessageUiHandler {
case MenuOptions.LOG_OUT:
success = true;
const doLogout = () => {
Utils.apiPost('account/logout').then(res => {
Utils.apiPost('account/logout', undefined, undefined, true).then(res => {
if (!res.ok)
console.error(`Log out failed (${res.status}: ${res.statusText})`);
Utils.setCookie(Utils.sessionIdKey, '');