Fix jwt-token

This commit is contained in:
2025-08-20 06:36:56 +02:00
parent c479006770
commit e6b72eb35d
2 changed files with 6 additions and 10 deletions

View File

@@ -63,13 +63,16 @@ class DeviceProbeSimulator:
return False
try:
# ONLY send the exact format requested: {type:"heartbeat", key:"device_id"}
payload = {
'type': 'heartbeat',
'key': device['unique_key'] # Use the device's unique key
'key': str(device_id) # Use device_id as the key
}
print(f"📡 Sending heartbeat: {payload}")
response = self.session.post(
f"{self.api_base_url}/devices/heartbeat",
f"{self.api_base_url}/heartbeat", # Changed to correct endpoint
json=payload,
timeout=10
)