Fix jwt-token

This commit is contained in:
2025-09-07 16:25:43 +02:00
parent 9d75abc88f
commit 5b57be01d0
2 changed files with 20 additions and 0 deletions

18
approve_devices.js Normal file
View File

@@ -0,0 +1,18 @@
const axios = require('axios');
// Simple script to approve all pending devices for testing
async function approveAllDevices() {
try {
// First, we need to get an auth token - for now let's use the direct database approach
console.log('This script would need authentication. Instead, run these SQL commands:');
console.log('');
console.log('UPDATE devices SET is_approved = true, is_active = true WHERE is_approved = false;');
console.log('');
console.log('Or use the admin interface to approve devices individually.');
} catch (error) {
console.error('Error approving devices:', error.message);
}
}
approveAllDevices();

View File

@@ -185,6 +185,8 @@ async function handleHeartbeat(req, res) {
approval_required: true
});
}
// Device exists and is approved - continue with heartbeat processing
// Update device's last heartbeat
await device.update({ last_heartbeat: new Date() });