浏览代码

controlbox: Add JID validation to the login form

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

+ 1 - 1
CHANGES.md

@@ -9,7 +9,7 @@
 
 ### New features and improvements
 - Add support for Emojis (either native, or via <a href="https://www.emojione.com/">Emojione</a>). [jcbrand]
-- Add JID validation to the contact add form and the occupant invite form. [jcbrand]
+- Add JID validation to the contact add form, the occupant invite form and the login form. [jcbrand]
 - #896 Consistently use `XMPP username` in user-facing text (instead of JID, Jabber ID etc.). [jcbrand]
 
 ### New configuration settings

+ 1 - 1
src/converse-controlbox.js

@@ -423,7 +423,7 @@
                     let jid = $jid_input.val(),
                         errors = false;
 
-                    if (!jid) {
+                    if (!jid || _.filter(jid.split('@')).length < 2) {
                         errors = true;
                         $jid_input.addClass('error');
                     }