This commit is contained in:
Bruno Rybársky 2024-02-03 17:15:21 +01:00
parent 8073d6c29e
commit 6753603ecd

@ -105,10 +105,9 @@ function doLogin($email, $password): array
$lastLoginAt = null; $lastLoginAt = null;
$loginCount = 0; $loginCount = 0;
$stmt->bind_result($uid, $first_name, $last_name, $nickname, $password_hash, $minecraft_nickname, $privilege_level, $lastLoginAt, $loginCount); $stmt->bind_result($uid, $first_name, $last_name, $nickname, $password_hash, $minecraft_nickname, $privilege_level, $lastLoginAt, $loginCount);
if ($stmt->num_rows() > 0) {
echo "user found";
$stmt->fetch(); $stmt->fetch();
echo "user found";
if (password_verify($password, $password_hash)) { if (password_verify($password, $password_hash)) {
$found = true; $found = true;
@ -118,7 +117,6 @@ function doLogin($email, $password): array
$updateLoginStmt->execute(); $updateLoginStmt->execute();
$updateLoginStmt->close(); $updateLoginStmt->close();
} }
}
$_SESSION["ID"] = $uid; $_SESSION["ID"] = $uid;
$_SESSION["first_name"] = $first_name; $_SESSION["first_name"] = $first_name;