overdid it with the image upload auth, making it a regular upload

This commit is contained in:
Ro 2021-08-02 15:34:21 -07:00
parent cad32ace74
commit b3c47d6721
4 changed files with 27 additions and 22 deletions

View file

@ -188,21 +188,30 @@ class APIControl
break;
case "settings":
$token = $request->getHeader("fipamo-access-token");
if (Session::verifyToken($token[0])) {
if (isset($body)) {
$postBody = $body;
} else {
$postBody = null;
}
$task = $args["fourth"];
if ($task == "add-feature-background" || $task == "add-avatar") {
$result = SettingsAPI::handleSettingsTask($request, $args, $postBody);
} else {
$token = $request->getHeader("fipamo-access-token");
if (Session::verifyToken($token[0])) {
$result = SettingsAPI::handleSettingsTask(
$request,
$args,
$postBody
);
} else {
$result = [
"message" => "API access denied, homie",
"type" => "API_ERROR",
];
}
}
break;
case "mailer":
$result = MailerAPI::handleMail($request, $body, $response);

File diff suppressed because one or more lines are too long

View file

@ -266,8 +266,7 @@ class MaintenanceManager {
}
};
if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) {
if (eventType === TASK_UPLOAD_FILES)
request.setRequestHeader("fipamo-access-token", self.token);
//if (eventType === TASK_UPLOAD_FILES) request.setRequestHeader("fipamo-access-token", self.token);
switch (contentType) {
case CONTENT_TYPE_JSON:
request.setRequestHeader(

View file

@ -18,10 +18,7 @@ export default class SettingsIndex {
null,
"fe79df250470815bf32dcea70221384c89163cad3a827a9c3da25d87159ed55a"
);
this.mm = new Maintenance(
null,
"fe79df250470815bf32dcea70221384c89163cad3a827a9c3da25d87159ed55a"
);
this.mm = new Maintenance(null, null);
}
//--------------------------
// methods