die e-mail entfernt
Dieser Commit ist enthalten in:
@ -613,7 +613,7 @@ export default function UserManagement() {
|
||||
}
|
||||
|
||||
function PurgeUsersPanel({ onDone }: { onDone: () => void }) {
|
||||
const [email, setEmail] = useState('hendrik.gebhardt@polizei.nrw.de')
|
||||
const [email, setEmail] = useState('')
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [msg, setMsg] = useState('')
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ async function createTestUser() {
|
||||
try {
|
||||
console.log('\n=== Creating Test User ===\n');
|
||||
|
||||
const email = 'hendrik.gebhardt@polizei.nrw.de';
|
||||
const email = 'test.user@example.com';
|
||||
const hashedPassword = await bcryptjs.hash('test123', 10);
|
||||
const encryptedEmail = encrypt(email);
|
||||
const emailHash = hashEmail(email);
|
||||
@ -40,7 +40,7 @@ async function createTestUser() {
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`).run(
|
||||
userId,
|
||||
'hendrik.gebhardt',
|
||||
'test.user',
|
||||
encryptedEmail,
|
||||
emailHash,
|
||||
hashedPassword,
|
||||
@ -52,7 +52,7 @@ async function createTestUser() {
|
||||
|
||||
console.log('✓ Test user created successfully!');
|
||||
console.log('Email:', email);
|
||||
console.log('Username: hendrik.gebhardt');
|
||||
console.log('Username: test.user');
|
||||
console.log('Password: test123');
|
||||
console.log('Role: user');
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
// Purge users from DB, keeping only 'admin' and a specific email
|
||||
// Usage (Windows CMD/PowerShell from backend directory):
|
||||
// npm run purge-users -- --email hendrik.gebhardt@polizei.nrw.de
|
||||
// If --email is omitted, defaults to 'hendrik.gebhardt@polizei.nrw.de'
|
||||
// Usage (from backend directory):
|
||||
// npm run purge-users -- --email someone@example.com
|
||||
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
@ -24,7 +23,7 @@ function hashLower(text) {
|
||||
function parseEmailArg() {
|
||||
const idx = process.argv.indexOf('--email')
|
||||
if (idx !== -1 && process.argv[idx + 1]) return process.argv[idx + 1]
|
||||
return 'hendrik.gebhardt@polizei.nrw.de'
|
||||
return null
|
||||
}
|
||||
|
||||
function backupFile(filePath) {
|
||||
@ -43,6 +42,10 @@ function backupFile(filePath) {
|
||||
function main() {
|
||||
const dbPath = getDbPath()
|
||||
const keepEmail = parseEmailArg()
|
||||
if (!keepEmail) {
|
||||
console.error("❌ Bitte E-Mail angeben: --email someone@example.com")
|
||||
process.exit(1)
|
||||
}
|
||||
const keepHash = hashLower(keepEmail)
|
||||
|
||||
console.log(`Datenbank: ${dbPath}`)
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren