diff --git a/app/server.js b/app/server.js index 44f18c5..cbcb7e2 100755 --- a/app/server.js +++ b/app/server.js @@ -144,8 +144,13 @@ app.get('/join/', (req, res) => { console.log('Request query', req.query); // http://localhost:8000/join?user=user1 // http://localhost:8000/join?user=user2&call=user1 - const { user, call } = req.query; + const { user, call, password } = req.query; if (user || (user && call)) { + if (config.roomPasswordEnabled && password !== config.roomPassword) { + // http://localhost:8000/join?user=user1&password=123456789 + // http://localhost:8000/join?user=user2&call=user1&password=123456789 + return notFound(res); + } return res.sendFile(HOME); } return notFound(res); diff --git a/package.json b/package.json index ee3d468..5503394 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "call-me", - "version": "1.0.34", + "version": "1.0.35", "description": "Your Go-To for Instant Video Calls", "author": "Miroslav Pejic - miroslav.pejic.85@gmail.com", "license": "AGPLv3", diff --git a/public/client.js b/public/client.js index 3777be6..b566bbf 100755 --- a/public/client.js +++ b/public/client.js @@ -40,7 +40,6 @@ document.addEventListener('DOMContentLoaded', function () { handleDirectJoin(); handleListeners(); fetchRandomImage(); - checkRoomPassword(); }); // githubDiv.style.display = 'none'; @@ -170,8 +169,9 @@ function handleDirectJoin() { const usp = new URLSearchParams(window.location.search); const user = usp.get('user'); const call = usp.get('call'); + const password = usp.get('password'); - console.log('Direct Join detected', { user, call }); + console.log('Direct Join detected', { user, call, password }); if (user) { // SignIn @@ -184,6 +184,8 @@ function handleDirectJoin() { handleCallClick(); } } + + if (!password) checkRoomPassword(); } // Session Time