This commit is contained in:
@@ -39,7 +39,7 @@ function getRoomPasswords(uid) {
|
||||
return { moderatorPW: modPw, attendeePW: attPw };
|
||||
}
|
||||
|
||||
export async function createMeeting(room) {
|
||||
export async function createMeeting(room, logoutURL) {
|
||||
const { moderatorPW, attendeePW } = getRoomPasswords(room.uid);
|
||||
const params = {
|
||||
meetingID: room.uid,
|
||||
@@ -54,6 +54,9 @@ export async function createMeeting(room) {
|
||||
'meta_bbb-origin': 'Redlight',
|
||||
'meta_bbb-origin-server-name': 'Redlight',
|
||||
};
|
||||
if (logoutURL) {
|
||||
params.logoutURL = logoutURL;
|
||||
}
|
||||
if (room.max_participants > 0) {
|
||||
params.maxParticipants = room.max_participants.toString();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ const __dirname = path.dirname(__filename);
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3001;
|
||||
|
||||
// Trust proxy for correct req.protocol behind reverse proxy
|
||||
app.set('trust proxy', true);
|
||||
|
||||
// Middleware
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
|
||||
@@ -198,7 +198,7 @@ router.post('/:uid/start', authenticateToken, async (req, res) => {
|
||||
return res.status(404).json({ error: 'Raum nicht gefunden oder keine Berechtigung' });
|
||||
}
|
||||
|
||||
await createMeeting(room);
|
||||
await createMeeting(room, `${req.protocol}://${req.get('host')}`);
|
||||
const joinUrl = await joinMeeting(room.uid, req.user.name, true);
|
||||
res.json({ joinUrl });
|
||||
} catch (err) {
|
||||
@@ -326,7 +326,7 @@ router.post('/:uid/guest-join', async (req, res) => {
|
||||
|
||||
// If meeting not running but anyone_can_start, create it
|
||||
if (!running && room.anyone_can_start) {
|
||||
await createMeeting(room);
|
||||
await createMeeting(room, `${req.protocol}://${req.get('host')}`);
|
||||
}
|
||||
|
||||
// Check moderator code
|
||||
|
||||
Reference in New Issue
Block a user