[mirotalksfu] - #124 keep room name through authentication
هذا الالتزام موجود في:
@@ -241,6 +241,14 @@ function startServer() {
|
||||
app.get(['/logged'], (req, res) => {
|
||||
const ip = getIP(req);
|
||||
if (allowedIP(ip)) {
|
||||
if (Object.keys(req.query).length > 0) {
|
||||
log.debug('Logged: Direct Join', req.query);
|
||||
// http://localhost:3010/?room=test or http://localhost:3010/join?room=test
|
||||
const { room } = checkXSS(req.query);
|
||||
if (room) {
|
||||
return res.sendFile(views.room);
|
||||
}
|
||||
}
|
||||
res.sendFile(views.landing);
|
||||
} else {
|
||||
hostCfg.authenticated = false;
|
||||
|
||||
@@ -105,9 +105,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let usernameInput = document.getElementById('username');
|
||||
let passwordInput = document.getElementById('password');
|
||||
let loginBtn = document.getElementById('loginButton');
|
||||
const usernameInput = document.getElementById('username');
|
||||
const passwordInput = document.getElementById('password');
|
||||
const loginBtn = document.getElementById('loginButton');
|
||||
|
||||
const qs = new URLSearchParams(window.location.search);
|
||||
const room = filterXSS(qs.get('room'));
|
||||
|
||||
usernameInput.onkeyup = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
@@ -138,7 +141,7 @@
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log(response);
|
||||
window.location.href = '/logged';
|
||||
window.location.href = '/logged/?room=' + room;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error);
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم