Browse Source

core: use _.get since connection might not be set up yet

JC Brand 5 years ago
parent
commit
487f1b5281
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/headless/converse-core.js

+ 1 - 1
src/headless/converse-core.js

@@ -490,7 +490,7 @@ function connect (credentials) {
             BOSH_WAIT
         );
     } else if (_converse.authentication === _converse.LOGIN) {
-        const password = credentials ? credentials.password : (_converse.connection.pass || _converse.password);
+        const password = credentials ? credentials.password : (_.get(_converse.connection, 'pass') || _converse.password);
         if (!password) {
             if (_converse.auto_login) {
                 throw new Error("autoLogin: If you use auto_login and "+