Use cookie auth for legacy EEPROM endpoints.

This commit is contained in:
flash 2025-04-12 21:19:52 +00:00
parent f38aee7e4d
commit fc5952dda9
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
2 changed files with 4 additions and 10 deletions
src/mami.js

View file

@ -1,8 +1,6 @@
const MamiEEPROM = function(endPoint, getAuthLine) {
const MamiEEPROM = function(endPoint) {
if(typeof endPoint !== 'string')
throw 'endPoint must be a string';
if(typeof getAuthLine !== 'function')
throw 'getAuthLine must be a function';
// when the pools rewrite happen, retrieve this from futami common
const appId = '1';
@ -40,9 +38,7 @@ const MamiEEPROM = function(endPoint, getAuthLine) {
const { status, body } = await $xhr.post(`${endPoint}/uploads`, {
type: 'json',
headers: {
Authorization: getAuthLine(),
},
authed: true,
upload: reportProgress,
abort: handler => abortHandler = handler,
}, formData);
@ -77,9 +73,7 @@ const MamiEEPROM = function(endPoint, getAuthLine) {
const { status, body } = await $xhr.delete(fileInfo.urlf, {
type: 'json',
headers: {
Authorization: getAuthLine(),
},
authed: true,
});
if(status !== 204) {

View file

@ -702,7 +702,7 @@ const MamiInit = async args => {
});
ctx.eeprom = new MamiEEPROM(futami.get('eeprom2'), MamiMisuzuAuth.getLine);
ctx.eeprom = new MamiEEPROM(futami.get('eeprom2'));
sbUploads.addOption({
name: 'view',