Fix jwt-token
This commit is contained in:
@@ -57,16 +57,21 @@ async function seedDatabase() {
|
|||||||
console.log('✅ Admin user already exists for uamils-ab tenant');
|
console.log('✅ Admin user already exists for uamils-ab tenant');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if tumanovsky user exists
|
// Check if tumanovsky user exists
|
||||||
const existingTumanovsky = await User.findOne({ where: { username: 'tumanovsky' } });
|
const existingTumanovsky = await User.findOne({
|
||||||
|
where: {
|
||||||
|
username: 'tumanovsky',
|
||||||
|
tenant_id: defaultTenant.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (!existingTumanovsky) {
|
if (!existingTumanovsky) {
|
||||||
// Create tumanovsky admin user
|
// Create tumanovsky admin user for uamils-ab tenant
|
||||||
const tumanovskyPassword = await bcrypt.hash('tumanovsky', 10);
|
const tumanovskyPassword = await bcrypt.hash('tumanovsky', 10);
|
||||||
|
|
||||||
await User.create({
|
await User.create({
|
||||||
username: 'tumanovsky',
|
username: 'tumanovsky',
|
||||||
email: 'tumanovsky@dronedetection.local',
|
email: 'tumanovsky@uamils.com',
|
||||||
password_hash: tumanovskyPassword,
|
password_hash: tumanovskyPassword,
|
||||||
first_name: 'Tumanovsky',
|
first_name: 'Tumanovsky',
|
||||||
last_name: 'Admin',
|
last_name: 'Admin',
|
||||||
@@ -74,12 +79,13 @@ async function seedDatabase() {
|
|||||||
is_active: true,
|
is_active: true,
|
||||||
sms_alerts_enabled: true,
|
sms_alerts_enabled: true,
|
||||||
email_alerts_enabled: true,
|
email_alerts_enabled: true,
|
||||||
timezone: 'Europe/Stockholm'
|
timezone: 'Europe/Stockholm',
|
||||||
|
tenant_id: defaultTenant.id
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('✅ Tumanovsky admin user created (username: tumanovsky, password: tumanovsky)');
|
console.log('✅ Tumanovsky admin user created for uamils-ab tenant (username: tumanovsky, password: tumanovsky)');
|
||||||
} else {
|
} else {
|
||||||
console.log('✅ Tumanovsky user already exists');
|
console.log('✅ Tumanovsky user already exists for uamils-ab tenant');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create sample devices if none exist
|
// Create sample devices if none exist
|
||||||
@@ -93,7 +99,12 @@ async function seedDatabase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get admin user for alert rules
|
// Get admin user for alert rules
|
||||||
const adminUser = await User.findOne({ where: { username: 'admin' } });
|
const adminUser = await User.findOne({
|
||||||
|
where: {
|
||||||
|
username: 'admin',
|
||||||
|
tenant_id: defaultTenant.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Create location-specific alert rules
|
// Create location-specific alert rules
|
||||||
const alertRuleCount = await AlertRule.count();
|
const alertRuleCount = await AlertRule.count();
|
||||||
|
|||||||
Reference in New Issue
Block a user