This commit is contained in:
@@ -39,7 +39,7 @@ function getRoomPasswords(uid) {
|
|||||||
return { moderatorPW: modPw, attendeePW: attPw };
|
return { moderatorPW: modPw, attendeePW: attPw };
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createMeeting(room) {
|
export async function createMeeting(room, logoutURL) {
|
||||||
const { moderatorPW, attendeePW } = getRoomPasswords(room.uid);
|
const { moderatorPW, attendeePW } = getRoomPasswords(room.uid);
|
||||||
const params = {
|
const params = {
|
||||||
meetingID: room.uid,
|
meetingID: room.uid,
|
||||||
@@ -54,6 +54,9 @@ export async function createMeeting(room) {
|
|||||||
'meta_bbb-origin': 'Redlight',
|
'meta_bbb-origin': 'Redlight',
|
||||||
'meta_bbb-origin-server-name': 'Redlight',
|
'meta_bbb-origin-server-name': 'Redlight',
|
||||||
};
|
};
|
||||||
|
if (logoutURL) {
|
||||||
|
params.logoutURL = logoutURL;
|
||||||
|
}
|
||||||
if (room.max_participants > 0) {
|
if (room.max_participants > 0) {
|
||||||
params.maxParticipants = room.max_participants.toString();
|
params.maxParticipants = room.max_participants.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ const __dirname = path.dirname(__filename);
|
|||||||
const app = express();
|
const app = express();
|
||||||
const PORT = process.env.PORT || 3001;
|
const PORT = process.env.PORT || 3001;
|
||||||
|
|
||||||
|
// Trust proxy for correct req.protocol behind reverse proxy
|
||||||
|
app.set('trust proxy', true);
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.use(express.json());
|
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' });
|
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);
|
const joinUrl = await joinMeeting(room.uid, req.user.name, true);
|
||||||
res.json({ joinUrl });
|
res.json({ joinUrl });
|
||||||
} catch (err) {
|
} 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 meeting not running but anyone_can_start, create it
|
||||||
if (!running && room.anyone_can_start) {
|
if (!running && room.anyone_can_start) {
|
||||||
await createMeeting(room);
|
await createMeeting(room, `${req.protocol}://${req.get('host')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check moderator code
|
// Check moderator code
|
||||||
|
|||||||
@@ -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 { useAuth } from '../contexts/AuthContext';
|
||||||
import { useLanguage } from '../contexts/LanguageContext';
|
import { useLanguage } from '../contexts/LanguageContext';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
@@ -47,16 +47,6 @@ export default function Navbar({ onMenuClick }) {
|
|||||||
>
|
>
|
||||||
<Menu size={20} />
|
<Menu size={20} />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Search */}
|
|
||||||
<div className="hidden md:flex items-center gap-2 bg-th-bg-s border border-th-border rounded-lg px-3 py-2 w-64 lg:w-80">
|
|
||||||
<Search size={16} className="text-th-text-s flex-shrink-0" />
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder={t('common.search')}
|
|
||||||
className="bg-transparent border-none outline-none text-sm text-th-text placeholder-th-text-s w-full"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right section */}
|
{/* Right section */}
|
||||||
|
|||||||
@@ -182,6 +182,8 @@
|
|||||||
"guestAccessDenied": "Zugang nicht möglich",
|
"guestAccessDenied": "Zugang nicht möglich",
|
||||||
"guestNameRequired": "Name ist erforderlich",
|
"guestNameRequired": "Name ist erforderlich",
|
||||||
"guestJoinFailed": "Beitritt fehlgeschlagen",
|
"guestJoinFailed": "Beitritt fehlgeschlagen",
|
||||||
|
"guestAccessNotEnabled": "Der Gastzugang ist für diesen Raum nicht aktiviert.",
|
||||||
|
"guestWrongAccessCode": "Falscher Zugangscode",
|
||||||
"guestHasAccount": "Haben Sie ein Konto?",
|
"guestHasAccount": "Haben Sie ein Konto?",
|
||||||
"guestSignIn": "Anmelden",
|
"guestSignIn": "Anmelden",
|
||||||
"guestRoomNotFound": "Raum nicht gefunden"
|
"guestRoomNotFound": "Raum nicht gefunden"
|
||||||
|
|||||||
@@ -182,6 +182,8 @@
|
|||||||
"guestAccessDenied": "Access denied",
|
"guestAccessDenied": "Access denied",
|
||||||
"guestNameRequired": "Name is required",
|
"guestNameRequired": "Name is required",
|
||||||
"guestJoinFailed": "Join failed",
|
"guestJoinFailed": "Join failed",
|
||||||
|
"guestAccessNotEnabled": "Guest access is not enabled for this room.",
|
||||||
|
"guestWrongAccessCode": "Wrong access code",
|
||||||
"guestHasAccount": "Have an account?",
|
"guestHasAccount": "Have an account?",
|
||||||
"guestSignIn": "Sign in",
|
"guestSignIn": "Sign in",
|
||||||
"guestRoomNotFound": "Room not found"
|
"guestRoomNotFound": "Room not found"
|
||||||
|
|||||||
@@ -24,7 +24,14 @@ export default function GuestJoin() {
|
|||||||
setRoomInfo(res.data.room);
|
setRoomInfo(res.data.room);
|
||||||
setStatus({ running: res.data.running });
|
setStatus({ running: res.data.running });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err.response?.data?.error || t('room.guestRoomNotFound'));
|
const status = err.response?.status;
|
||||||
|
if (status === 403) {
|
||||||
|
setError(t('room.guestAccessNotEnabled'));
|
||||||
|
} else if (status === 404) {
|
||||||
|
setError(t('room.guestRoomNotFound'));
|
||||||
|
} else {
|
||||||
|
setError(t('room.guestRoomNotFound'));
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -61,7 +68,14 @@ export default function GuestJoin() {
|
|||||||
window.location.href = res.data.joinUrl;
|
window.location.href = res.data.joinUrl;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast.error(err.response?.data?.error || t('room.guestJoinFailed'));
|
const status = err.response?.status;
|
||||||
|
if (status === 403) {
|
||||||
|
toast.error(t('room.guestWrongAccessCode'));
|
||||||
|
} else if (status === 400) {
|
||||||
|
toast.error(t('room.guestWaitingMessage'));
|
||||||
|
} else {
|
||||||
|
toast.error(t('room.guestJoinFailed'));
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
setJoining(false);
|
setJoining(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user