Commit 734991f1 authored by JC Brand's avatar JC Brand

Fixes #907: unnecessary validation error

parent 4da41310
......@@ -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.
......
......@@ -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');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment