- fix: sistemato pagina gruppo che non si visualizzava (errore per modifica)

- fix: corretto il "Invia RIS" al gruppo.
This commit is contained in:
Surya Paolo
2025-03-13 18:19:42 +01:00
parent f32bd189dc
commit f713f66369
10 changed files with 113 additions and 31 deletions

View File

@@ -33,8 +33,6 @@ const authenticate = async (req, res, next) => {
//const idapp = getIdApp(req);
try {
console.log(' ### Authenticate: token', !!token);
const ris = await User.findByToken(token, access, true, false);
if (ris && ris.user && !!ris.user.deleted) {
if (ris.user.deleted)
@@ -50,7 +48,6 @@ const authenticate = async (req, res, next) => {
}
if (!!ris.user) {
console.log(' AUTH 2) ');
// crea una funzione per aggiornare il lasttimeonline e useragent
// Save last time online
const myuser = await User.updateLastTimeAndUserAgent(ris.user._id, req.get('User-Agent'));
@@ -59,7 +56,6 @@ const authenticate = async (req, res, next) => {
// req.refreshToken = refreshToken;
req.access = access;
console.log(' AUTH 3) NEXT... ');
next(); // Esegui il codice successivo
}
} catch (e) {
@@ -146,7 +142,7 @@ const authenticate_noerror = async (req, res, next) => {
try {
const token = req.header('x-auth');
const refreshToken = req.header('x-refrtok');
console.log(' ### Authenticate_noerror: token', !!token);
// console.log(' ### Authenticate_noerror: token', !!token);
if (!token) {
req.user = null;
@@ -173,7 +169,7 @@ const authenticate_noerror = async (req, res, next) => {
return res.status(server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED).send();
}
console.log(' ## NEXT ! AVANTI...');
// console.log(' ## NEXT ! AVANTI...');
next();
} catch (e) {
console.error('Errore nel middleware di autenticazione:', e);
@@ -187,7 +183,7 @@ const authenticate_noerror_WithUser = async (req, res, next) => {
try {
const token = req.header('x-auth');
const refreshToken = req.header('x-refrtok');
console.log(' ### authenticate_noerror_WithUser: token', !!token);
// console.log(' ### authenticate_noerror_WithUser: token', !!token);
if (!token) {
req.user = null;
@@ -229,7 +225,7 @@ const authenticate_noerror_WithUserLean = async (req, res, next) => {
try {
const token = req.header('x-auth');
const refreshToken = req.header('x-refrtok');
console.log(' ### authenticate_noerror_WithUserLean: token', !!token);
// console.log(' ### authenticate_noerror_WithUserLean: token', !!token);
if (!token) {
req.user = null;