fix: update documentation and configuration files

This commit is contained in:
2026-03-29 19:26:50 -07:00
parent 00aa8cf044
commit 26d9c7e79e
50 changed files with 6264 additions and 2627 deletions
+56
View File
@@ -0,0 +1,56 @@
const { PrismaClient } = require('@prisma/client');
const crypto = require('crypto');
const prisma = new PrismaClient();
async function main() {
try {
// Use built-in crypto for quick hash (we'll update with proper one after)
const salt = crypto.randomBytes(16).toString('hex');
const hash = crypto.pbkdf2Sync('admin', salt, 10000, 64, 'sha256').toString('hex');
const fullHash = `${salt}:${hash}`;
// Generate cuid-like ID
const cuid = `clx_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
// Check if user exists
const existing = await prisma.user.findUnique({
where: { email: 'david@dhg.lol' }
});
if (existing) {
await prisma.user.delete({ where: { id: existing.id } });
}
// Create admin user
const user = await prisma.user.create({
data: {
id: cuid,
email: 'david@dhg.lol',
emailVerified: true,
role: 'club_admin',
name: 'David Admin',
accounts: {
create: {
id: `${cuid}_acc`,
accountId: `${cuid}_acc`,
providerId: 'credential',
password: fullHash,
}
}
}
});
console.log('✅ Admin user created successfully!');
console.log(' Email:', user.email);
console.log(' Role:', user.role);
console.log(' Password: admin');
} catch (error) {
console.error('❌ Error:', error.message);
} finally {
await prisma.$disconnect();
}
}
main();