Skip to content

Commit

Permalink
[mirotalksfu] - improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Oct 19, 2024
1 parent c1d9680 commit b198ba8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
19 changes: 13 additions & 6 deletions app/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dev dependencies: {
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.92
* @version 1.5.93
*
*/

Expand Down Expand Up @@ -511,7 +511,12 @@ function startServer() {
if (isPeerPresenter && !hostCfg.users_from_db) {
const roomAllowedForUser = await isRoomAllowedForUser('Direct Join with token', username, room);
if (!roomAllowedForUser) {
return res.status(401).json({ message: 'Direct Room Join for this User is Unauthorized' });
log.warn('Direct Room Join for this User is Unauthorized', {
username: username,
room: room,
});
return res.redirect('/whoAreYou/' + room);
//return res.status(401).json({ message: 'Direct Room Join for this User is Unauthorized' });
}
}
} catch (err) {
Expand All @@ -524,7 +529,9 @@ function startServer() {
const allowRoomAccess = isAllowedRoomAccess('/join/params', req, hostCfg, roomList, room);
const roomAllowedForUser = await isRoomAllowedForUser('Direct Join without token', name, room);
if (!allowRoomAccess && !roomAllowedForUser) {
return res.status(401).json({ message: 'Direct Room Join Unauthorized' });
log.warn('Direct Room Join Unauthorized', room);
return res.redirect('/whoAreYou/' + room);
//return res.status(401).json({ message: 'Direct Room Join Unauthorized' });
}
}

Expand Down Expand Up @@ -578,9 +585,9 @@ function startServer() {
}
// 2. Protect room access with configuration check
if (!OIDC.enabled && hostCfg.protected && !hostCfg.users_from_db) {
const roomExists = hostCfg.users.some(user =>
user.allowed_rooms && user.allowed_rooms.includes(roomId)
);
const roomExists = hostCfg.users.some(
(user) => user.allowed_rooms && user.allowed_rooms.includes(roomId),
);
log.debug('/join/:roomId exists from config allowed rooms', roomExists);
return roomExists ? res.sendFile(views.room) : res.redirect('/whoAreYou/' + roomId);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.5.92",
"version": "1.5.93",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion public/js/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ function joinRoom() {
return;
}

window.location.href = '/join/' + roomName;
//window.location.href = '/join/' + roomName;
window.location.href = '/join/?room=' + roomName;
window.localStorage.lastRoom = roomName;
}

Expand Down
4 changes: 2 additions & 2 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.92
* @version 1.5.93
*
*/

Expand Down Expand Up @@ -4500,7 +4500,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.5.92',
title: 'WebRTC SFU v1.5.93',
html: `
<br />
<div id="about">
Expand Down
2 changes: 1 addition & 1 deletion public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.92
* @version 1.5.93
*
*/

Expand Down

0 comments on commit b198ba8

Please sign in to comment.