Enhance ESLint configuration for TypeScript and React, update dependencies, and add new super admin setup script. Update README for improved clarity on superuser setup options and modify user interface components for better user experience.
This commit is contained in:
43
scripts/setup-oliver-admin.js
Normal file
43
scripts/setup-oliver-admin.js
Normal file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { createOliverSuperAdmin } from '../src/lib/admin.js';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
function setupOliverAdmin() {
|
||||
try {
|
||||
console.log('Setting up Oliver as Super Admin...');
|
||||
|
||||
const oliverAdmin = createOliverSuperAdmin();
|
||||
|
||||
// Save to file for reference
|
||||
const outputPath = path.join(process.cwd(), 'oliver-super-admin.json');
|
||||
fs.writeFileSync(outputPath, JSON.stringify(oliverAdmin, null, 2));
|
||||
|
||||
console.log('✅ Oliver Super Admin setup complete!');
|
||||
console.log('\nUser Details:');
|
||||
console.log(`Email: ${oliverAdmin.email}`);
|
||||
console.log(`Username: ${oliverAdmin.username}`);
|
||||
console.log(`Display Name: ${oliverAdmin.displayName}`);
|
||||
console.log(`Role: Super Administrator`);
|
||||
console.log(`Permissions: ${oliverAdmin.permissions.length} total`);
|
||||
console.log('\nYou can now log in with:');
|
||||
console.log(`Email: ${oliverAdmin.email}`);
|
||||
console.log(`Password: (any password will work in demo mode)`);
|
||||
console.log('\nTo use this account:');
|
||||
console.log('1. Copy the user data from oliver-super-admin.json');
|
||||
console.log('2. In your browser console, run:');
|
||||
console.log(` localStorage.setItem('scriptshare-user-data', '${JSON.stringify(oliverAdmin)}')`);
|
||||
console.log(` localStorage.setItem('scriptshare-auth-token', '${Math.random().toString(36).substring(2) + Date.now().toString(36)}')`);
|
||||
console.log('3. Refresh the page and you should be logged in as Oliver Super Admin');
|
||||
|
||||
console.log(`\nUser data saved to: ${outputPath}`);
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error setting up Oliver Super Admin:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the setup
|
||||
setupOliverAdmin();
|
Reference in New Issue
Block a user