Cosmetics
[vchess.git] / server / models / User.js
index 5117c17..9b3049b 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.+-]+$/)))
     );
   },
 
@@ -118,7 +118,7 @@ const UserModel =
   notify: function(user, message)
   {
     const subject = "vchess.club - notification";
-    const body = "Hello " + user.name + "!" + `
+    const body = "Hello " + user.name + " !" + `
 ` + message;
     sendEmail(params.mail.noreply, user.email, subject, body);
   },