Pannello Utente
Aggiornamento Yarn - Notifiche (1)
This commit is contained in:
@@ -403,6 +403,36 @@ router.post('/profile', authenticate, (req, res) => {
|
||||
|
||||
});
|
||||
|
||||
router.post('/panel', authenticate, async (req, res) => {
|
||||
const username = req.body['username'];
|
||||
idapp = req.body.idapp;
|
||||
locale = req.body.locale;
|
||||
|
||||
if (!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm)) {
|
||||
// If without permissions, exit
|
||||
return res.status(404).
|
||||
send({code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: ''});
|
||||
}
|
||||
|
||||
try {
|
||||
const myuser = await User.findOne({idapp, username},
|
||||
{username: 1, email: 1, verified_by_aportador: 1, aportador_solidario: 1,
|
||||
lasttimeonline: 1,
|
||||
deleted: 1,
|
||||
profile: 1}).lean();
|
||||
if (!!myuser) {
|
||||
res.send(myuser);
|
||||
} else {
|
||||
tools.mylog('ERRORE IN panel: ' + e.message);
|
||||
res.status(400).send();
|
||||
}
|
||||
} catch (e) {
|
||||
tools.mylogserr('Error profile: ', e);
|
||||
res.status(400).send();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
router.post('/login', (req, res) => {
|
||||
var body = _.pick(req.body,
|
||||
['username', 'password', 'idapp', 'keyappid', 'lang']);
|
||||
|
||||
Reference in New Issue
Block a user