Fix Bugs
This commit is contained in:
1 parent
3f4e859153
commit
e53e53146c
1 file changed
+6
-4
+6
-4
@@ -12,16 +12,18 @@ if ($_SERVER["REQUEST_METHOD"] !== "POST") {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($_POST["username"]) || !isset($_POST["password"]) || !isset($_POST["password_repeat"])) {
|
$input = json_decode(file_get_contents("php://input"), true);
|
||||||
|
|
||||||
|
if (!isset($input["username"]) || !isset($input["password"]) || !isset($input["password_repeat"])) {
|
||||||
$api->answer(400, [
|
$api->answer(400, [
|
||||||
"error" => "missing_fields",
|
"error" => "missing_fields",
|
||||||
"error_text" => "Some fields are missing"
|
"error_text" => "Some fields are missing"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$username = $_POST["username"];
|
$username = $input["username"];
|
||||||
$password = $_POST["password"];
|
$password = $input["password"];
|
||||||
$password_repeat = $_POST["password_repeat"];
|
$password_repeat = $input["password_repeat"];
|
||||||
|
|
||||||
// Check Passwords
|
// Check Passwords
|
||||||
if ($password !== $password_repeat) {
|
if ($password !== $password_repeat) {
|
||||||
|
|||||||
Reference in new issue
Block a user