reformat and cleanup; Add auth error to response on internal login(debug)
This commit is contained in:
@@ -127,9 +127,7 @@ class MatrixMessage
|
|||||||
private $message;
|
private $message;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$this->message = array(
|
$this->message = ["msgtype" => "m.notice"];
|
||||||
"msgtype" => "m.notice",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_type($msgtype) {
|
function set_type($msgtype) {
|
||||||
|
|||||||
@@ -15,14 +15,6 @@ abstract class LoginRequester {
|
|||||||
$loginRequester = LoginRequester::UNDEFINED;
|
$loginRequester = LoginRequester::UNDEFINED;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$input = json_decode('
|
|
||||||
{
|
|
||||||
"user": {
|
|
||||||
"id": "@matrix.id.of.the.user:example.com",
|
|
||||||
"password": "passwordOfTheUser"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
',true);
|
|
||||||
$inputJSON = file_get_contents('php://input');
|
$inputJSON = file_get_contents('php://input');
|
||||||
$input = json_decode($inputJSON, TRUE);
|
$input = json_decode($inputJSON, TRUE);
|
||||||
$mxid = NULL;
|
$mxid = NULL;
|
||||||
@@ -101,7 +93,7 @@ try {
|
|||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
error_log("Auth failed with error: " . $e->getMessage());
|
error_log("Auth failed with error: " . $e->getMessage());
|
||||||
//$response["auth"]["error"] = $e->getMessage();
|
$response["auth"]["error"] = $e->getMessage();
|
||||||
}
|
}
|
||||||
print (json_encode($response, JSON_PRETTY_PRINT) . "\n");
|
print (json_encode($response, JSON_PRETTY_PRINT) . "\n");
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user