This commit is contained in:
Timo Knuth
2026-02-27 15:19:24 +01:00
parent b7f8221095
commit 253c3c1c6d
134 changed files with 11188 additions and 1871 deletions

View File

@@ -1,12 +1,9 @@
import { PrismaClient } from '@prisma/client'
import bcrypt from 'bcryptjs'
const prisma = new PrismaClient()
// bcrypt-compatible hash using better-auth's default (sha256 fallback for seeding)
// better-auth uses its own hashing — we use the auth API to set a real password instead.
// For seeding we insert a known bcrypt hash for "demo1234".
// Generated with: https://bcrypt-generator.com/ (rounds=10)
const DEMO_PASSWORD_HASH = '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lHny'
const DEMO_PASSWORD_HASH = bcrypt.hashSync('demo1234', 10)
async function main() {
console.log('Seeding database...')
@@ -42,7 +39,7 @@ async function main() {
// Create password account so email+password login works in dev
await prisma.account.upsert({
where: { id: 'demo-admin-account-id' },
update: {},
update: { password: DEMO_PASSWORD_HASH },
create: {
id: 'demo-admin-account-id',
accountId: adminUser.id,