historique::getIdRef("CONNEXION"), "idUser" => $connect["id"], "idPage" => historique::getIdRef("/api/authenticator/"), "log" => $_SERVER['REMOTE_ADDR'] )); // Réponse JSON en cas de succès echo json_encode([ "status" => $connect["status"], "message" => "Login successful", "session_id" => session_id(), "type" => $connect["type"], "id" => $connect["id"], "prenom" => $connect["prenom"], "nom" => $connect["nom"], "googleAuthenticator" => $connect["googleAuthenticator"], "idType" => $connect["idType"], "email" => $connect["email"] ]); } else { // Authentification échouée http_response_code(401); // Code 401 Unauthorized echo json_encode([ "status" => "error", "message" => "Invalid email or password" ]); } }