weiter die Sache mit Auth

This commit is contained in:
2026-03-01 07:52:31 +00:00
parent 0678fdcaa7
commit 1ccd66b307
16 changed files with 693 additions and 5 deletions

35
debug-auth.js Normal file
View File

@@ -0,0 +1,35 @@
const bcrypt = require('bcryptjs');
// Direkt aus .env kopiert
const AUTH_USERS = 'rxf:$2b$10$VdshbfnSFZIn59QJqDRiROi.ekU83ObiQBM.R3MVaSIcGQb5eYbEq';
console.log('=== AUTH DEBUG ===\n');
console.log('AUTH_USERS:', AUTH_USERS);
console.log('');
const usersString = AUTH_USERS || '';
const users = usersString
.split(',')
.map((userPair) => {
const [username, passwordHash] = userPair.trim().split(':');
return { username: username?.trim(), passwordHash: passwordHash?.trim() };
})
.filter((user) => user.username && user.passwordHash);
console.log('Parsed users:', JSON.stringify(users, null, 2));
console.log('');
// Test credentials
const testUser = 'rxf';
const testPassword = 'Fluorit';
const user = users.find(u => u.username === testUser);
console.log('Found user:', user);
console.log('');
if (user) {
console.log('Testing password:', testPassword);
console.log('Against hash:', user.passwordHash);
const result = bcrypt.compareSync(testPassword, user.passwordHash);
console.log('Result:', result);
}