Fix jwt-token
This commit is contained in:
@@ -30,6 +30,31 @@ async function seedDatabase() {
|
|||||||
console.log('✅ Admin user already exists');
|
console.log('✅ Admin user already exists');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if tumanovsky user exists
|
||||||
|
const existingTumanovsky = await User.findOne({ where: { username: 'tumanovsky' } });
|
||||||
|
|
||||||
|
if (!existingTumanovsky) {
|
||||||
|
// Create tumanovsky admin user
|
||||||
|
const tumanovskyPassword = await bcrypt.hash('tumanovsky', 10);
|
||||||
|
|
||||||
|
await User.create({
|
||||||
|
username: 'tumanovsky',
|
||||||
|
email: 'tumanovsky@dronedetection.local',
|
||||||
|
password_hash: tumanovskyPassword,
|
||||||
|
first_name: 'Tumanovsky',
|
||||||
|
last_name: 'Admin',
|
||||||
|
role: 'admin',
|
||||||
|
is_active: true,
|
||||||
|
sms_alerts_enabled: true,
|
||||||
|
email_alerts_enabled: true,
|
||||||
|
timezone: 'Europe/Stockholm'
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('✅ Tumanovsky admin user created (username: tumanovsky, password: tumanovsky)');
|
||||||
|
} else {
|
||||||
|
console.log('✅ Tumanovsky user already exists');
|
||||||
|
}
|
||||||
|
|
||||||
// Create sample devices if none exist
|
// Create sample devices if none exist
|
||||||
const deviceCount = await Device.count();
|
const deviceCount = await Device.count();
|
||||||
if (deviceCount === 0) {
|
if (deviceCount === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user