Fix jwt-token

This commit is contained in:
2025-09-17 18:47:16 +02:00
parent 4a62aa8960
commit 490bd86d0c

View File

@@ -9,10 +9,10 @@ async function createStockholmDevice() {
return;
}
// Check if device "1" already exists
const existingDevice = await Device.findOne({ where: { id: '1' } });
// Check if device "1941875381" already exists (from your test packet)
const existingDevice = await Device.findOne({ where: { id: '1941875381' } });
if (existingDevice) {
console.log('✅ Stockholm Castle device already exists');
console.log('✅ Test device already exists');
console.log(` ID: ${existingDevice.id}`);
console.log(` Name: ${existingDevice.name}`);
console.log(` Approved: ${existingDevice.is_approved}`);
@@ -21,33 +21,33 @@ async function createStockholmDevice() {
return;
}
// Create Stockholm Castle device
const stockholmDevice = await Device.create({
id: '1',
name: 'Stockholm Castle',
// Create test device with the ID from your packet
const testDevice = await Device.create({
id: '1941875381',
name: 'Test Device 1941875381',
type: 'drone_detector',
location: 'Stockholm Castle, Sweden',
description: 'Drone detector at Stockholm Castle monitoring royal grounds',
location: 'Test Location',
description: 'Test drone detector device',
is_approved: true,
is_active: true,
tenant_id: tenant.id,
coordinates: JSON.stringify({
latitude: 59.3251,
longitude: 18.0719
latitude: 0,
longitude: 0
}),
config: JSON.stringify({
detection_range: 25000, // 25km range
alert_threshold: 5000, // Alert when within 5km
detection_range: 25000,
alert_threshold: 5000,
frequency_bands: ['2.4GHz', '5.8GHz'],
sensitivity: 'high'
})
});
console.log('✅ Stockholm Castle device created successfully');
console.log(` ID: ${stockholmDevice.id}`);
console.log(` Name: ${stockholmDevice.name}`);
console.log(` Tenant: ${stockholmDevice.tenant_id}`);
console.log(` Approved: ${stockholmDevice.is_approved}`);
console.log('✅ Test device created successfully');
console.log(` ID: ${testDevice.id}`);
console.log(` Name: ${testDevice.name}`);
console.log(` Tenant: ${testDevice.tenant_id}`);
console.log(` Approved: ${testDevice.is_approved}`);
} catch (error) {
console.error('❌ Error creating Stockholm device:', error.message);
@@ -56,7 +56,7 @@ async function createStockholmDevice() {
createStockholmDevice()
.then(() => {
console.log('✅ Stockholm device setup completed');
console.log('✅ Test device setup completed');
process.exit(0);
})
.catch(error => {