-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-admin.mjs
More file actions
32 lines (28 loc) · 959 Bytes
/
Copy pathsetup-admin.mjs
File metadata and controls
32 lines (28 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { authService } from './server/auth.ts';
async function setupAdmin() {
try {
const users = await authService.getAllUsers();
console.log('Existing users:', users.length);
if (users.length === 0) {
console.log('Creating default admin user...');
const defaultAdmin = {
email: 'hr@infinitisoftware.net',
password: 'admin123',
fullName: 'System Administrator',
role: 'admin',
assignedBy: 1
};
await authService.createUser(defaultAdmin);
console.log('✓ Admin user created successfully');
console.log('Login credentials:');
console.log('Email: hr@infinitisoftware.net');
console.log('Password: admin123');
} else {
console.log('Admin user already exists');
console.log('Try logging in with: hr@infinitisoftware.net / admin123');
}
} catch (error) {
console.error('Setup failed:', error.message);
}
}
setupAdmin();