Experimental news notification system + fix Eightpieces variant
[vchess.git] / server / routes / users.js
index 2b38c37..389625c 100644 (file)
@@ -81,6 +81,12 @@ router.put('/update', access.logged, access.ajax, (req,res) => {
   }
 });
 
+// Special route to update newsRead timestamp:
+router.put('/newsread', access.logged, access.ajax, (req,res) => {
+  UserModel.setNewsRead(req.userId);
+  res.json({});
+});
+
 // Authentication-related methods:
 
 // to: object user (to who we send an email)
@@ -90,7 +96,7 @@ function setAndSendLoginToken(subject, to, res)
   const token = genToken(params.token.length);
   UserModel.setLoginToken(token, to.id);
   const body =
-    "Hello " + to.name + "!" + `
+    "Hello " + to.name + " !" + `
 ` +
     "Access your account here: " +
     params.siteURL + "/#/authenticate/" + token + `