From 168f29cf062ea5d73b688ffe2ddd72732e4200d4 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 9 Jul 2019 12:34:41 +0200 Subject: [PATCH] Only call `credentials_url` when `authentication` is set to `login` Also update to newer strophe.js version which contains a bugfix. --- package-lock.json | 4 ++-- src/headless/converse-core.js | 5 +++-- src/headless/package.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 650fdae35..566a2c7bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13771,8 +13771,8 @@ } }, "strophe.js": { - "version": "github:strophe/strophejs#31f31b52fd37a92eebee7b47d668a7d7dc40df3b", - "from": "github:strophe/strophejs#31f31b52fd37a92eebee7b47d668a7d7dc40df3b" + "version": "github:strophe/strophejs#c572c9b1a5c95529784b363fcfe927b281c2f62e", + "from": "github:strophe/strophejs#c572c9b1a5c95529784b363fcfe927b281c2f62e" }, "style-loader": { "version": "0.23.1", diff --git a/src/headless/converse-core.js b/src/headless/converse-core.js index cf85624d8..9922a23b6 100644 --- a/src/headless/converse-core.js +++ b/src/headless/converse-core.js @@ -1223,7 +1223,7 @@ _converse.initialize = async function (settings, callback) { if (credentials) { this.autoLogin(credentials); } else if (this.auto_login) { - if (this.credentials_url) { + if (this.credentials_url && _converse.authentication === 'login') { const data = await getLoginCredentials(); this.autoLogin(data); } else if (!this.jid) { @@ -1235,7 +1235,8 @@ _converse.initialize = async function (settings, callback) { "(via credentials_url)." ); } else { - this.autoLogin(); // Could be ANONYMOUS or EXTERNAL + // Could be ANONYMOUS or EXTERNAL or manual passing in of JID and password + this.autoLogin(); } } else if (reconnecting) { this.autoLogin(); diff --git a/src/headless/package.json b/src/headless/package.json index ad382251c..d2a05db19 100644 --- a/src/headless/package.json +++ b/src/headless/package.json @@ -29,7 +29,7 @@ "jed": "1.1.1", "lodash": "^4.17.11", "pluggable.js": "2.0.1", - "strophe.js": "strophe/strophejs#31f31b52fd37a92eebee7b47d668a7d7dc40df3b", + "strophe.js": "strophe/strophejs#c572c9b1a5c95529784b363fcfe927b281c2f62e", "twemoji": "^11.0.1", "urijs": "^1.19.1" }