diff --git a/server/config/bbb.js b/server/config/bbb.js index 3784f5b..5792fca 100644 --- a/server/config/bbb.js +++ b/server/config/bbb.js @@ -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(); } diff --git a/server/index.js b/server/index.js index 6e4ef89..5a3e5e7 100644 --- a/server/index.js +++ b/server/index.js @@ -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()); diff --git a/server/routes/rooms.js b/server/routes/rooms.js index 5fde173..f2dcd35 100644 --- a/server/routes/rooms.js +++ b/server/routes/rooms.js @@ -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 diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index ed1755d..069b705 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -1,4 +1,4 @@ -import { Menu, Search, LogOut, User } from 'lucide-react'; +import { Menu, LogOut, User } from 'lucide-react'; import { useAuth } from '../contexts/AuthContext'; import { useLanguage } from '../contexts/LanguageContext'; import { useNavigate } from 'react-router-dom'; @@ -47,16 +47,6 @@ export default function Navbar({ onMenuClick }) { >
- - {/* Search */} -