[call-me] - #3 handle room password in direct join

This commit is contained in:
Miroslav Pejic
2024-12-28 15:58:18 +01:00
parent 27ec390b9f
commit 4b59c0304a
3 changed files with 11 additions and 4 deletions
+6 -1
View File
@@ -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);
+1 -1
View File
@@ -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",
+4 -2
View File
@@ -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