[call-me] - #3 handle room password in direct join
This commit is contained in:
+6
-1
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user