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