From a449223b401694f48d842432302cf0a6cdd22359 Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 15 Sep 2016 16:32:10 -0500 Subject: [PATCH 1/2] Clears the password if user cancels password prompt. Clears the password if user cancel attempt to enter password, as using one instance of locker for multiple attempts keeps the password. --- modules/UI/authentication/RoomLocker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/UI/authentication/RoomLocker.js b/modules/UI/authentication/RoomLocker.js index 2e9c55715..de08a4b53 100644 --- a/modules/UI/authentication/RoomLocker.js +++ b/modules/UI/authentication/RoomLocker.js @@ -185,6 +185,10 @@ export default function createRoomLocker (room) { newPass => { password = newPass; } ).catch( reason => { + // user canceled, no pass was entered. + // clear, as if we use the same instance several times + // pass stays between attempts + password = null; if (reason !== APP.UI.messageHandler.CANCEL) console.error(reason); } From 02165786f151c5a02fbdbf7b005080319e9278ca Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 15 Sep 2016 16:34:02 -0500 Subject: [PATCH 2/2] Handles case where somebody removed lock of the room while we attempt to join. Receiving password required, marks the room as locked, but if we try to enter without password, mark it as unlocked till we receive a password required error or we successfully join. --- conference.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conference.js b/conference.js index 4fd421b00..c586953f1 100644 --- a/conference.js +++ b/conference.js @@ -357,6 +357,14 @@ class ConferenceConnector { case ConferenceErrors.PASSWORD_REQUIRED: APP.UI.markRoomLocked(true); roomLocker.requirePassword().then(function () { + let pass = roomLocker.password; + // we received that password is required, but user is trying + // anyway to login without a password, mark room as not locked + // in case he succeeds (maybe someone removed the password + // meanwhile), if it is still locked another password required + // will be received and the room again will be marked as locked + if (!pass) + APP.UI.markRoomLocked(false); room.join(roomLocker.password); }); break;