fix: use BetterAuth's hashPassword for seed
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user