Merge pull request #59 from H4CK3R-01/block_empty_room_or_user

Empty usernames or room-names are not allowed
This commit is contained in:
Florian Kaiser 2021-07-11 16:03:13 +02:00 committed by GitHub
commit 6c2f8371c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ document.getElementById('ok').addEventListener('click', function () {
username = document.getElementById('username').value;
room_name = document.getElementById('room').value;
if (username !== "" && room_name !== "") {
socket = io("/", {
closeOnBeforeunload: false
});
@ -51,6 +52,9 @@ document.getElementById('ok').addEventListener('click', function () {
socket.on('user left', function (data) {
addLogMessage(data + ' left');
});
} else {
document.getElementById('error').innerText = 'Username and/or room name cannot be empty!';
}
});
function open_manual() {