mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
MVC: fix API regression caused by d7d016f400, closes https://github.com/opnsense/core/issues/7645
This commit is contained in:
parent
ba49c8b65f
commit
9024abe3f8
@ -274,6 +274,15 @@ class ApiControllerBase extends ControllerRoot
|
||||
} else {
|
||||
// link username on successful login
|
||||
$this->logged_in_user = $authResult['username'];
|
||||
// if body is send as json data, parse to $_POST first
|
||||
$dispatchError = $this->parseJsonBodyData();
|
||||
if ($dispatchError != null) {
|
||||
$this->response->setStatusCode(400, "Bad Request");
|
||||
$this->response->setContentType('application/json', 'UTF-8');
|
||||
$this->response->setJsonContent(['status' => 400, 'message' => $dispatchError]);
|
||||
$this->response->send();
|
||||
return false;
|
||||
}
|
||||
|
||||
// pass revision context to config object
|
||||
Config::getInstance()->setRevisionContext([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user