push
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user