Add password recovery page at /recover
This commit is contained in:
14
scripts/reset-password.ts
Normal file
14
scripts/reset-password.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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());
|
||||
Reference in New Issue
Block a user