Skip to content

Commit

Permalink
add lobby support
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed May 28, 2024
1 parent 1e916f4 commit a5a7889
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,27 @@ async function tokenize(req: Request): Promise<Response> {
let room = permissions.find(r => r.room === roomName);

if(room) {
// Check for lobby settings
const lobby = room.useLobby



const userName = userInfo["email"]
console.log(`Found config for room ${roomName}. Checking for user ${userName}`)
tokenRoom = roomName;
// check if the user is in the moderator list
if(room.moderators.includes(userName)) {
console.log(`${userName} is a moderator of ${roomName}`);
// we keep the defaults
// make use owner
userInfo["affiliation"] = "owner";
}
else {
console.log(`${userName} is not a moderator of ${roomName}`);
// reduce permissions
userInfo["affiliation"] = "member";
if(lobby) {
userInfo["lobby_bypass"] = false;
}

}
} else {
Expand Down Expand Up @@ -373,3 +382,4 @@ function main() {

// -----------------------------------------------------------------------------
main();

0 comments on commit a5a7889

Please sign in to comment.