nextjs-rewrite (#5)

Reviewed-on: #5
Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #5.
This commit is contained in:
2026-03-30 02:30:13 +00:00
committed by david
parent 1a9b3496e1
commit 123df671f5
160 changed files with 19293 additions and 1180 deletions
+51
View File
@@ -0,0 +1,51 @@
const { PrismaClient } = require('@prisma/client');
const bcrypt = require('bcryptjs');
const prisma = new PrismaClient();
async function main() {
try {
const newPassword = 'adminadmin';
// Find the admin user
const user = await prisma.user.findUnique({
where: { email: 'david@dhg.lol' }
});
if (!user) {
console.log('❌ Admin user not found');
return;
}
// Find the account
const account = await prisma.account.findFirst({
where: { userId: user.id }
});
if (!account) {
console.log('❌ Account not found for user');
return;
}
// Hash new password using bcrypt
const salt = await bcrypt.genSalt(12);
const passwordHash = await bcrypt.hash(newPassword, salt);
// Update the password
await prisma.account.update({
where: { id: account.id },
data: { password: passwordHash }
});
console.log('✅ Admin password updated successfully!');
console.log(' Email:', user.email);
console.log(' New Password:', newPassword);
} catch (error) {
console.error('❌ Error:', error.message);
} finally {
await prisma.$disconnect();
}
}
main();