Diverse anpassungen
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<div class="error-message"><%= error %></div>
|
||||
<% } %>
|
||||
|
||||
<form method="POST" action="/login">
|
||||
<form method="POST" action="/login" accept-charset="UTF-8" id="loginForm">
|
||||
<div class="form-group">
|
||||
<label for="username">Benutzername</label>
|
||||
<input type="text" id="username" name="username" required autofocus>
|
||||
@@ -40,6 +40,56 @@
|
||||
|
||||
<button type="submit" class="btn btn-primary">Anmelden</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Debug-Logging für LDAP-Authentifizierung mit UTF-8-Zeichen
|
||||
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
||||
const usernameInput = document.getElementById('username');
|
||||
const username = usernameInput.value;
|
||||
|
||||
console.group('🔍 LDAP Login Debug - Browser Console');
|
||||
console.log('=== Username Analysis ===');
|
||||
console.log('Original Input:', username);
|
||||
console.log('String Length:', username.length);
|
||||
console.log('Type:', typeof username);
|
||||
|
||||
// UTF-8 Byte-Repräsentation
|
||||
const encoder = new TextEncoder();
|
||||
const utf8Bytes = encoder.encode(username);
|
||||
console.log('UTF-8 Bytes:', Array.from(utf8Bytes));
|
||||
console.log('UTF-8 Bytes (Hex):', Array.from(utf8Bytes).map(b => '0x' + b.toString(16).padStart(2, '0')).join(' '));
|
||||
|
||||
// Einzelne Zeichen analysieren
|
||||
console.log('=== Character Analysis ===');
|
||||
for (let i = 0; i < username.length; i++) {
|
||||
const char = username[i];
|
||||
const codePoint = char.codePointAt(0);
|
||||
const utf8BytesForChar = encoder.encode(char);
|
||||
console.log(`Position ${i}: "${char}" | CodePoint: U+${codePoint.toString(16).toUpperCase().padStart(4, '0')} (${codePoint}) | UTF-8 Bytes: [${Array.from(utf8BytesForChar).join(', ')}]`);
|
||||
}
|
||||
|
||||
// Form-Daten, die gesendet werden
|
||||
console.log('=== Form Data ===');
|
||||
const formData = new FormData(this);
|
||||
const formDataObj = {};
|
||||
for (let [key, value] of formData.entries()) {
|
||||
if (key === 'password') {
|
||||
formDataObj[key] = '***hidden***';
|
||||
} else {
|
||||
formDataObj[key] = value;
|
||||
}
|
||||
}
|
||||
console.log('Form Data Object:', formDataObj);
|
||||
console.log('Username in FormData:', formData.get('username'));
|
||||
|
||||
// URL-Encoding Test
|
||||
console.log('=== URL Encoding Test ===');
|
||||
console.log('encodeURIComponent(username):', encodeURIComponent(username));
|
||||
console.log('encodeURI(username):', encodeURI(username));
|
||||
|
||||
console.groupEnd();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user