Преглед изворни кода

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
 ### New features and improvements
 - Add support for Emojis (either native, or via <a href="https://www.emojione.com/">Emojione</a>). [jcbrand]
 - 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]
 - #896 Consistently use `XMPP username` in user-facing text (instead of JID, Jabber ID etc.). [jcbrand]
 
 
 ### New configuration settings
 ### New configuration settings

+ 1 - 1
src/converse-controlbox.js

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