Skip to content

Commit

Permalink
[call-me] - #3 fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Dec 28, 2024
1 parent 776503f commit d79ebc7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ app.get('/randomImage', async (req, res) => {
app.get('/join/', (req, res) => {
if (Object.keys(req.query).length > 0) {
console.log('Request query', req.query);

const { user, call, password } = req.query;
// http://localhost:8000/join?user=user1
// http://localhost:8000/join?user=user2&call=user1
const { user, call, password } = req.query;
// http://localhost:8000/join?user=user1&password=123456789
// http://localhost:8000/join?user=user2&call=user1&password=123456789

if (config.roomPasswordEnabled && password !== config.roomPassword) {
return unauthorized(res);
}

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 unauthorized(res);
}
return res.sendFile(HOME);
}
return notFound(res);
Expand Down

0 comments on commit d79ebc7

Please sign in to comment.