diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index bc34254..8b74152 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -1314,7 +1314,14 @@ export default class RoomClient await this.sendRequest('changeDisplayName', { displayName }); break; } + + case 'signInRequired': + { + store.dispatch(stateActions.setSignInRequired(true)); + break; + } + case 'roomReady': { store.dispatch(stateActions.toggleJoined()); diff --git a/app/src/actions/stateActions.js b/app/src/actions/stateActions.js index 598b50a..8a8d545 100644 --- a/app/src/actions/stateActions.js +++ b/app/src/actions/stateActions.js @@ -53,6 +53,14 @@ export const setInLobby = (inLobby) => }; }; +export const setSignInRequired = (signInRequired) => +{ + return { + type : 'SET_SIGN_IN_REQUIRED', + payload : { signInRequired } + }; +}; + export const setAccessCode = (accessCode) => { return { diff --git a/app/src/components/JoinDialog.js b/app/src/components/JoinDialog.js index faa6d60..a34b850 100644 --- a/app/src/components/JoinDialog.js +++ b/app/src/components/JoinDialog.js @@ -198,7 +198,16 @@ const JoinDialog = ({ :
Ok, you are ready
- The room is looked - hang on until somebody lets you in ... + { room.signInRequired ? +
+ The room is empty! + You can Log In to start the meeting or wait until the host joins. +
+ : +
+ The room is locked - hang on until somebody lets you in ... +
+ }
} @@ -252,6 +261,7 @@ export default withRoomContext(connect( { return ( prev.room.inLobby === next.room.inLobby && + prev.room.signInRequired === next.room.signInRequired && prev.settings.displayName === next.settings.displayName && prev.me.loginEnabled === next.me.loginEnabled && prev.me.loggedIn === next.me.loggedIn && diff --git a/app/src/reducers/room.js b/app/src/reducers/room.js index a1f4fcc..0d650d3 100644 --- a/app/src/reducers/room.js +++ b/app/src/reducers/room.js @@ -5,6 +5,7 @@ const initialState = state : 'new', // new/connecting/connected/disconnected/closed, locked : false, inLobby : false, + signInRequired : false, accessCode : '', // access code to the room if locked and joinByAccessCode == true joinByAccessCode : true, // if true: accessCode is a possibility to open the room activeSpeakerId : null, @@ -66,6 +67,13 @@ const room = (state = initialState, action) => return { ...state, inLobby }; } + case 'SET_SIGN_IN_REQUIRED': + { + const { signInRequired } = action.payload; + + return { ...state, signInRequired }; + } + case 'SET_ACCESS_CODE': { const { accessCode } = action.payload; diff --git a/server/lib/Lobby.js b/server/lib/Lobby.js index d961ccb..1b537f7 100644 --- a/server/lib/Lobby.js +++ b/server/lib/Lobby.js @@ -1,5 +1,7 @@ const EventEmitter = require('events').EventEmitter; const Logger = require('./Logger'); +const config = require('../config/config'); + const logger = new Logger('Lobby'); @@ -89,6 +91,9 @@ class Lobby extends EventEmitter this._notification(peer.socket, 'enteredLobby'); + if (config.requireSignInToAccess && !peer.authenticated && !super.isLocked) + this._notification(peer.socket, 'signInRequired'); + this._peers.set(peer.id, peer); peer.on('authenticationChanged', () => diff --git a/server/lib/Room.js b/server/lib/Room.js index 3144ce9..97eab18 100644 --- a/server/lib/Room.js +++ b/server/lib/Room.js @@ -83,6 +83,11 @@ class Room extends EventEmitter this._handleAudioLevelObserver(); } + isLocked() + { + return this._locked; + } + close() { logger.debug('close()');