});
};
const anonymous = {name:"", email:"", id:0, notify:false};
- console.log(req.cookies); //TODO: cookie not found after authenticate ?
if (!req.cookies.token)
return callback(anonymous);
UserModel.getOne("sessionToken", req.cookies.token, function(err, user) {
params.siteURL + "/#/authenticate/" + token + "\\n" +
"Token will expire in " + params.token.expire/(1000*60) + " minutes."
sendEmail(params.mail.noreply, to.email, subject, body, err => {
- // "id" is generally the only info missing on client side,
- // but the name is also unknown if log-in with the email.
- res.json(err || {id: to.id, name: to.name});
+ res.json(err || {});
});
});
}