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

pull/84/head
Ro 3 years ago
parent cad32ace74
commit b3c47d6721

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

File diff suppressed because one or more lines are too long

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

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

Loading…
Cancel
Save