fix: use BetterAuth's hashPassword for seed
This commit is contained in:
@@ -1,14 +1,7 @@
|
|||||||
import { db } from './index';
|
import { db } from './index';
|
||||||
import { users, accounts } from './schema';
|
import { users, accounts } from './schema';
|
||||||
import { eq } from 'drizzle-orm';
|
import { eq } from 'drizzle-orm';
|
||||||
|
import { hashPassword } from 'better-auth/crypto';
|
||||||
// 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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function seed() {
|
async function seed() {
|
||||||
const testEmail = 'test@test.com';
|
const testEmail = 'test@test.com';
|
||||||
|
|||||||
Reference in New Issue
Block a user