fix: use BetterAuth's hashPassword for seed

This commit is contained in:
2026-01-27 22:19:53 +00:00
parent 7bd506463e
commit 308ca4fc5e

View File

@@ -1,14 +1,7 @@
import { db } from './index';
import { users, accounts } from './schema';
import { eq } from 'drizzle-orm';
// Hash password using the same method as BetterAuth (bcrypt via Bun)
async function hashPassword(password: string): Promise<string> {
return await Bun.password.hash(password, {
algorithm: 'bcrypt',
cost: 10,
});
}
import { hashPassword } from 'better-auth/crypto';
async function seed() {
const testEmail = 'test@test.com';