From d6ef36b4b4322f4bd0f1dcba00e24b53afe24baa Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 2 May 2016 14:47:40 -0500 Subject: [PATCH] Passes the room name to connect when using authentication --- connection.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/connection.js b/connection.js index d5f405448..5add17e48 100644 --- a/connection.js +++ b/connection.js @@ -96,13 +96,14 @@ function connect(id, password, roomName) { * Show Authentication Dialog and try to connect with new credentials. * If failed to connect because of PASSWORD_REQUIRED error * then ask for password again. + * @param {string} [roomName] * @returns {Promise} */ -function requestAuth() { +function requestAuth(roomName) { return new Promise(function (resolve, reject) { let authDialog = LoginDialog.showAuthDialog( function (id, password) { - connect(id, password).then(function (connection) { + connect(id, password, roomName).then(function (connection) { authDialog.close(); resolve(connection); }, function (err) { @@ -156,7 +157,7 @@ export function openConnection({id, password, retry, roomName}) { if (config.token) { throw err; } else { - return requestAuth(); + return requestAuth(roomName); } } else { throw err;