Aggiornamento cataloghi...

This commit is contained in:
Surya Paolo
2025-04-11 18:49:59 +02:00
parent e1ca4ef17f
commit 8e8a3204a7
13 changed files with 509 additions and 88 deletions

View File

@@ -789,30 +789,30 @@ router.post('/login', checkBlocked, async (req, res) => {
resalreadysent = true;
}
res.status(401).send({ code: server_constants.RIS_CODE_LOGIN_ERR });
resalreadysent = true;
return res.status(401).send({ code: server_constants.RIS_CODE_LOGIN_ERR });
} else {
const myris = await user.generateAuthToken(req);
const usertosend = new User();
shared_consts.fieldsUserToChange().forEach((field) => {
usertosend[field] = user[field];
});
const subsExistonDb = await existSubScribe(usertosend._id, 'auth', req.get('User-Agent'));
res
.header('x-auth', myris.token)
.header('x-refrtok', myris.refreshToken)
.send({
usertosend,
code: server_constants.RIS_CODE_OK,
subsExistonDb,
});
}
const myris = await user.generateAuthToken(req);
const usertosend = new User();
shared_consts.fieldsUserToChange().forEach((field) => {
usertosend[field] = user[field];
});
const subsExistonDb = await existSubScribe(usertosend._id, 'auth', req.get('User-Agent'));
res
.header('x-auth', myris.token)
.header('x-refrtok', myris.refreshToken)
.send({
usertosend,
code: server_constants.RIS_CODE_OK,
subsExistonDb,
});
} catch (e) {
console.error('ERRORE IN LOGIN: ' + e.message);
if (!resalreadysent)