Add back missing authorization headers

This commit is contained in:
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); const systemData = JSON.stringify(data, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v);
if (!bypassLogin) { 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(response => response.text())
.then(error => { .then(error => {
this.scene.ui.savingIcon.hide(); this.scene.ui.savingIcon.hide();
@ -551,7 +551,7 @@ export class GameData {
const sessionData = this.getSessionSaveData(scene); const sessionData = this.getSessionSaveData(scene);
if (!bypassLogin) { 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(response => response.text())
.then(error => { .then(error => {
if (error) { if (error) {
@ -752,7 +752,7 @@ export class GameData {
if (success !== null && !success) if (success !== null && !success)
return resolve([false, false]); return resolve([false, false]);
const sessionData = this.getSessionSaveData(scene); 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) if (response.ok)
loggedInUser.lastSessionSlot = -1; loggedInUser.lastSessionSlot = -1;
return response.json(); return response.json();
@ -912,7 +912,7 @@ export class GameData {
updateUserInfo().then(success => { updateUserInfo().then(success => {
if (!success) if (!success)
return displayError(`Could not contact the server. Your ${dataName} data could not be imported.`); 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(response => response.text())
.then(error => { .then(error => {
if (error) { if (error) {

View File

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