Draft rematch (not working yet) + fix Crazyhouse getPromotedFen()
[vchess.git] / server / models / User.js
index 5117c17..2984af4 100644 (file)
@@ -20,8 +20,8 @@ const UserModel =
   checkNameEmail: function(o)
   {
     return (
-      (!o.name || o.name.match(/^[\w]+$/)) &&
-      (!o.email || o.email.match(/^[\w.+-]+@[\w.+-]+$/))
+      (!o.name || !!(o.name.match(/^[\w-]+$/))) &&
+      (!o.email || !!(o.email.match(/^[\w.+-]+@[\w.+-]+$/)))
     );
   },