浏览代码

Don't require `auto_login` to be true when using the API to log in

JC Brand 7 年之前
父节点
当前提交
43bbae9006
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 1 0
      CHANGES.md
  2. 7 6
      src/converse-core.js

+ 1 - 0
CHANGES.md

@@ -6,6 +6,7 @@
   can't be established.
 - Remove `Login` and `Registration` tabs and consolidate into one panel.
 - Add validation message for an invalid JID in the login form.
+- Don't require `auto_login` to be `true` when using the API to log in.
 - #828 Add routing for the `#converse-login` and `#converse-register` URL
   fragments, which will render the registration and login forms respectively.
 

+ 7 - 6
src/converse-core.js

@@ -1722,12 +1722,13 @@
             if (!reconnecting && this.keepalive && this.restoreBOSHSession()) {
                 return;
             }
-            if (this.auto_login) {
-                if (credentials) {
-                    // When credentials are passed in, they override prebinding
-                    // or credentials fetching via HTTP
-                    this.autoLogin(credentials);
-                } else if (this.credentials_url) {
+
+            if (credentials) {
+                // When credentials are passed in, they override prebinding
+                // or credentials fetching via HTTP
+                this.autoLogin(credentials);
+            } else if (this.auto_login) {
+                if (this.credentials_url) {
                     this.fetchLoginCredentials().then(
                         this.autoLogin.bind(this),
                         this.autoLogin.bind(this)