15 lines
442 B
TypeScript
15 lines
442 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
import { hashSync } from "bcryptjs";
|
|
|
|
const db = new PrismaClient();
|
|
|
|
async function main() {
|
|
const hash = hashSync("moonbase!", 10);
|
|
const result = await db.user.updateMany({
|
|
data: { passwordHash: hash, mustChangePassword: false },
|
|
});
|
|
console.log(`Reset password for ${result.count} user(s). Login with: moonbase!`);
|
|
}
|
|
|
|
main().catch(console.error).finally(() => db.$disconnect());
|