Use create call instead of join call with loginURL
All checks were successful
Build & Push Docker Image / build (push) Successful in 1m10s

This commit is contained in:
2026-02-26 09:20:41 +01:00
parent a6e400b6b7
commit 1e19aa24dd
2 changed files with 15 additions and 14 deletions

View File

@@ -341,10 +341,11 @@ router.post('/:uid/start', authenticateToken, async (req, res) => {
}
}
await createMeeting(room, `${req.protocol}://${req.get('host')}`);
const baseUrl = `${req.protocol}://${req.get('host')}`;
const loginURL = `${baseUrl}/join/${room.uid}`;
await createMeeting(room, baseUrl, loginURL);
const avatarURL = getUserAvatarURL(req, req.user);
const appLoginUrl = `${req.protocol}://${req.get('host')}/join/${room.uid}`;
const joinUrl = await joinMeeting(room.uid, req.user.name, true, avatarURL, appLoginUrl);
const joinUrl = await joinMeeting(room.uid, req.user.name, true, avatarURL);
res.json({ joinUrl });
} catch (err) {
console.error('Start meeting error:', err);
@@ -378,8 +379,7 @@ router.post('/:uid/join', authenticateToken, async (req, res) => {
const isShared = !isOwner && await db.get('SELECT id FROM room_shares WHERE room_id = ? AND user_id = ?', [room.id, req.user.id]);
const isModerator = isOwner || !!isShared || room.all_join_moderator;
const avatarURL = getUserAvatarURL(req, req.user);
const appLoginUrl = `${req.protocol}://${req.get('host')}/join/${room.uid}`;
const joinUrl = await joinMeeting(room.uid, req.user.name, isModerator, avatarURL, appLoginUrl);
const joinUrl = await joinMeeting(room.uid, req.user.name, isModerator, avatarURL);
res.json({ joinUrl });
} catch (err) {
console.error('Join meeting error:', err);
@@ -477,7 +477,9 @@ 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, `${req.protocol}://${req.get('host')}`);
const baseUrl = `${req.protocol}://${req.get('host')}`;
const loginURL = `${baseUrl}/join/${room.uid}`;
await createMeeting(room, baseUrl, loginURL);
}
// Check moderator code
@@ -488,8 +490,7 @@ router.post('/:uid/guest-join', async (req, res) => {
const baseUrl = `${req.protocol}://${req.get('host')}`;
const guestAvatarURL = `${baseUrl}/api/auth/avatar/initials/${encodeURIComponent(name.trim())}`;
const appLoginUrl = `${baseUrl}/join/${room.uid}`;
const joinUrl = await joinMeeting(room.uid, name.trim(), isModerator, guestAvatarURL, appLoginUrl);
const joinUrl = await joinMeeting(room.uid, name.trim(), isModerator, guestAvatarURL);
res.json({ joinUrl });
} catch (err) {
console.error('Guest join error:', err);