Files
Momento/memento-note/scripts/reset-password-auto.ts
Sepehr Ramezani e4d4e23dc7 chore: clean up repo for public release
- Remove BMAD framework, IDE configs, dev screenshots, test files,
  internal docs, and backup files
- Rename keep-notes/ to memento-note/
- Update all references from keep-notes to memento-note
- Add Apache 2.0 license with Commons Clause (non-commercial restriction)
- Add clean .gitignore and .env.docker.example
2026-04-20 22:48:06 +02:00

37 lines
878 B
TypeScript

import { prisma } from '../lib/prisma'
import bcrypt from 'bcryptjs'
async function main() {
const email = 'test@example.com'
const newPassword = 'password123'
console.log(`Resetting password for ${email}...`)
const hashedPassword = await bcrypt.hash(newPassword, 10)
try {
const user = await prisma.user.update({
where: { email },
data: {
password: hashedPassword,
resetToken: null,
resetTokenExpiry: null
},
})
console.log(`✅ Password successfully reset for ${user.email}`)
} catch (error) {
console.error('❌ Error resetting password:', error)
process.exit(1)
}
}
main()
.catch(e => {
console.error(e)
process.exit(1)
})
.finally(async () => {
await prisma.$disconnect()
})