This commit is contained in:
2025-04-13 15:19:59 +02:00
parent 1ea3e77fa8
commit 14f415e228
46 changed files with 14161 additions and 539 deletions

29
scripts/add-user.js Normal file
View File

@ -0,0 +1,29 @@
import { PrismaClient } from '@prisma/client';
import bcrypt from 'bcrypt';
const prisma = new PrismaClient();
async function createUser() {
try {
const hashedPassword = await bcrypt.hash('gk1510!', 10);
const user = await prisma.user.create({
data: {
email: 'gregor@klevze.si',
password: hashedPassword,
name: 'Gregor',
surname: 'Klevže',
active: true,
role: 'admin',
},
});
console.log('User created successfully:', user);
} catch (error) {
console.error('Error creating user:', error);
} finally {
await prisma.$disconnect();
}
}
createUser();