Registrazione: scegliere se Telegram o Email
This commit is contained in:
@@ -31,6 +31,10 @@ router.post('/', authenticate, (req, res) => {
|
||||
tools.mylog('crea SendMsg');
|
||||
const myrecmsg = new SendMsg(body);
|
||||
|
||||
if (req.user && req.user.username) {
|
||||
User.setOnLine(req.user.idapp, req.user.username);
|
||||
}
|
||||
|
||||
const check = tools.checkUserOk(myrecmsg.origin.username, req.user.username, res);
|
||||
if (check.exit) return check.ret;
|
||||
|
||||
@@ -74,6 +78,10 @@ router.get('/:username/:lastdataread/:idapp', authenticate, (req, res) => {
|
||||
const idapp = req.params.idapp;
|
||||
// var category = req.params.category;
|
||||
|
||||
if (req.user && req.user.username) {
|
||||
User.setOnLine(req.user.idapp, req.user.username);
|
||||
}
|
||||
|
||||
if (req.user.idapp !== idapp) {
|
||||
// I'm trying to get something not mine!
|
||||
return res.status(404).send({ code: server_constants.RIS_CODE_NOT_MY_USERNAME });
|
||||
|
||||
Reference in New Issue
Block a user