diff --git a/endpoints/global/account.php b/endpoints/global/account.php index 51da7f4..faec631 100644 --- a/endpoints/global/account.php +++ b/endpoints/global/account.php @@ -4,6 +4,7 @@ require_once "lib/account.php"; function endpoint($endpoint_data): array { + print_r($endpoint_data); return match ($endpoint_data["action"]) { //not logged in start diff --git a/lib/account.php b/lib/account.php index e6e8c85..181b300 100644 --- a/lib/account.php +++ b/lib/account.php @@ -83,7 +83,7 @@ function verifyPassword($userID, $password): bool $stmt->fetch(); $stmt->close(); - return !empty($password_hash) && password_verify($password, $password_hash); + return !empty($password_hash) && !empty($password) && password_verify($password, $password_hash); } function doLogin($email, $password): array @@ -108,7 +108,7 @@ function doLogin($email, $password): array if ($stmt->num_rows() > 0) { $stmt->fetch(); - if (password_verify($password, $password_hash) && $privilege_level >= $routerConfig["logged_in_default_permission_level"]) { + if (password_verify($password, $password_hash)) { $found = true; // Update LastLoginAt and LoginCount