diff --git a/CHANGES.md b/CHANGES.md index 555229162..817ae7426 100755 --- a/CHANGES.md +++ b/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. diff --git a/src/converse-core.js b/src/converse-core.js index b4f21b8bd..3130940f7 100755 --- a/src/converse-core.js +++ b/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)