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');
|
||||
}
|
||||
|
||||
// Check if tumanovsky user exists
|
||||
const existingTumanovsky = await User.findOne({ where: { username: 'tumanovsky' } });
|
||||
// Check if tumanovsky user exists
|
||||
const existingTumanovsky = await User.findOne({
|
||||
where: {
|
||||
username: 'tumanovsky',
|
||||
tenant_id: defaultTenant.id
|
||||
}
|
||||
});
|
||||
|
||||
if (!existingTumanovsky) {
|
||||
// Create tumanovsky admin user
|
||||
// Create tumanovsky admin user for uamils-ab tenant
|
||||
const tumanovskyPassword = await bcrypt.hash('tumanovsky', 10);
|
||||
|
||||
await User.create({
|
||||
username: 'tumanovsky',
|
||||
email: 'tumanovsky@dronedetection.local',
|
||||
email: 'tumanovsky@uamils.com',
|
||||
password_hash: tumanovskyPassword,
|
||||
first_name: 'Tumanovsky',
|
||||
last_name: 'Admin',
|
||||
@@ -74,12 +79,13 @@ async function seedDatabase() {
|
||||
is_active: true,
|
||||
sms_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 {
|
||||
console.log('✅ Tumanovsky user already exists');
|
||||
console.log('✅ Tumanovsky user already exists for uamils-ab tenant');
|
||||
}
|
||||
|
||||
// Create sample devices if none exist
|
||||
@@ -93,7 +99,12 @@ async function seedDatabase() {
|
||||
}
|
||||
|
||||
// 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
|
||||
const alertRuleCount = await AlertRule.count();
|
||||
|
||||
Reference in New Issue
Block a user