[mirotalksfu] - improvements
هذا الالتزام موجود في:
@@ -136,7 +136,8 @@ app.get(['/login'], (req, res) => {
|
||||
if (hostCfg.protected == true) {
|
||||
let ip = getIP(req);
|
||||
log.debug(`Request login to host from: ${ip}`, req.query);
|
||||
if (req.query.username == hostCfg.username && req.query.password == hostCfg.password) {
|
||||
const { username, password } = req.query;
|
||||
if (username == hostCfg.username && password == hostCfg.password) {
|
||||
hostCfg.authenticated = true;
|
||||
authHost = new Host(ip, true);
|
||||
log.debug('LOGIN OK', { ip: ip, authorized: authHost.isAuthorized(ip) });
|
||||
@@ -171,12 +172,8 @@ app.get('/join/', (req, res) => {
|
||||
if (hostCfg.authenticated && Object.keys(req.query).length > 0) {
|
||||
log.debug('Direct Join', req.query);
|
||||
// http://localhost:3010/join?room=test&name=mirotalksfu&audio=1&video=1¬ify=1
|
||||
let roomName = req.query.room;
|
||||
let peerName = req.query.name;
|
||||
let peerAudio = req.query.audio;
|
||||
let peerVideo = req.query.video;
|
||||
let notify = req.query.notify;
|
||||
if (roomName && peerName && peerAudio && peerVideo && notify) {
|
||||
const { room, name, audio, video, notify } = req.query;
|
||||
if (room && name && audio && video && notify) {
|
||||
return res.sendFile(view.room);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,17 +101,48 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let usernameInput = document.getElementById('username');
|
||||
let passwordInput = document.getElementById('password');
|
||||
let loginBtn = document.getElementById('loginButton');
|
||||
|
||||
usernameInput.onkeyup = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
login();
|
||||
}
|
||||
};
|
||||
passwordInput.onkeyup = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
login();
|
||||
}
|
||||
};
|
||||
|
||||
loginBtn.onclick = (e) => {
|
||||
login();
|
||||
};
|
||||
|
||||
function login() {
|
||||
let username = document.getElementById('username').value;
|
||||
let password = document.getElementById('password').value;
|
||||
|
||||
if (username && password) {
|
||||
window.location.href = `/login?username=${username}&password=${password}`;
|
||||
return;
|
||||
}
|
||||
alert('Username and Password required');
|
||||
};
|
||||
if (!username && !password) {
|
||||
alert('Username and Password required');
|
||||
return;
|
||||
}
|
||||
if (!username) {
|
||||
alert('Username required');
|
||||
return;
|
||||
}
|
||||
if (!password) {
|
||||
alert('Password required');
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<div class="hero-figure anime-element">
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم