Use cookie auth for legacy EEPROM endpoints.
This commit is contained in:
parent
f38aee7e4d
commit
fc5952dda9
2 changed files with 4 additions and 10 deletions
|
@ -1,8 +1,6 @@
|
||||||
const MamiEEPROM = function(endPoint, getAuthLine) {
|
const MamiEEPROM = function(endPoint) {
|
||||||
if(typeof endPoint !== 'string')
|
if(typeof endPoint !== 'string')
|
||||||
throw 'endPoint must be a 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
|
// when the pools rewrite happen, retrieve this from futami common
|
||||||
const appId = '1';
|
const appId = '1';
|
||||||
|
@ -40,9 +38,7 @@ const MamiEEPROM = function(endPoint, getAuthLine) {
|
||||||
|
|
||||||
const { status, body } = await $xhr.post(`${endPoint}/uploads`, {
|
const { status, body } = await $xhr.post(`${endPoint}/uploads`, {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
headers: {
|
authed: true,
|
||||||
Authorization: getAuthLine(),
|
|
||||||
},
|
|
||||||
upload: reportProgress,
|
upload: reportProgress,
|
||||||
abort: handler => abortHandler = handler,
|
abort: handler => abortHandler = handler,
|
||||||
}, formData);
|
}, formData);
|
||||||
|
@ -77,9 +73,7 @@ const MamiEEPROM = function(endPoint, getAuthLine) {
|
||||||
|
|
||||||
const { status, body } = await $xhr.delete(fileInfo.urlf, {
|
const { status, body } = await $xhr.delete(fileInfo.urlf, {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
headers: {
|
authed: true,
|
||||||
Authorization: getAuthLine(),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if(status !== 204) {
|
if(status !== 204) {
|
||||||
|
|
|
@ -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({
|
sbUploads.addOption({
|
||||||
name: 'view',
|
name: 'view',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue