diff --git a/CHANGES.md b/CHANGES.md index 1ea1dcb59..6a934dd98 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ ### Bugfixes - Various IE11 fixes. +- #907 Unnecessary login validation error when `default_domain` or `locked_domain` are set. - #908 Login form for inVerse is only 200px when `allow_registration` is set to `false`. - #909 Translations written as template literals [aren't parsed properly by xgettext](https://savannah.gnu.org/bugs/?50920). - #911 Use `getDefaultNickName` consistently to allow better overrides via plugins. diff --git a/src/converse-controlbox.js b/src/converse-controlbox.js index 8a46f62ec..b1f7821cf 100644 --- a/src/converse-controlbox.js +++ b/src/converse-controlbox.js @@ -405,6 +405,8 @@ }, authenticate (ev) { + /* Authenticate the user based on a form submission event. + */ if (ev && ev.preventDefault) { ev.preventDefault(); } const $form = $(ev.target); if (_converse.authentication === _converse.ANONYMOUS) { @@ -418,10 +420,14 @@ let jid = $jid_input.val(), errors = false; - if (!jid || _.filter(jid.split('@')).length < 2) { + if (!jid || ( + !_converse.locked_domain && + !_converse.default_domain && + _.filter(jid.split('@')).length < 2)) { errors = true; $jid_input.addClass('error'); } + if (!password && _converse.authentication !== _converse.EXTERNAL) { errors = true; $pw_input.addClass('error');