Fix jwt-token
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
const bcrypt = require('bcryptjs');
|
||||
const { User, Device, AlertRule } = require('./models');
|
||||
const { User, Device, AlertRule, ManagementUser } = require('./models');
|
||||
const { createInitialManagementUser } = require('./scripts/seed-management-users');
|
||||
|
||||
async function seedDatabase() {
|
||||
try {
|
||||
console.log('🌱 Seeding database...');
|
||||
|
||||
// Check if admin user exists
|
||||
// First, create management users (platform admins)
|
||||
await createInitialManagementUser();
|
||||
|
||||
// Check if admin user exists (legacy tenant admin)
|
||||
const existingAdmin = await User.findOne({ where: { username: 'admin' } });
|
||||
|
||||
if (!existingAdmin) {
|
||||
|
||||
Reference in New Issue
Block a user