- Aggiornato node.js alla versione 22.18.1
- Aggiornato tutti i pacchetti del server all'ultima versione. - passato mongoose da versione 5 a versione 6
This commit is contained in:
@@ -771,7 +771,9 @@ UserSchema.statics.findByToken = async function (token, typeaccess, con_auth) {
|
||||
check_expiry_date = true
|
||||
}
|
||||
|
||||
if (check_expiry_date && (decoded.exp < Date.now() / 1000)) {
|
||||
let tempo = Date.now() / 1000;
|
||||
|
||||
if (check_expiry_date && (decoded.exp < tempo)) {
|
||||
console.log('Il token è scaduto, generazione del nuovo token...');
|
||||
code = server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED;
|
||||
} else {
|
||||
@@ -4227,9 +4229,7 @@ UserSchema.statics.findAllIdApp = async function (idapp) {
|
||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||
};
|
||||
|
||||
return await User.find(myfind, (err, arrrec) => {
|
||||
return arrrec;
|
||||
});
|
||||
return await tools.findAllQueryIdApp(this, myfind);
|
||||
};
|
||||
|
||||
UserSchema.statics.DuplicateAllRecords = async function (idapporig, idappdest) {
|
||||
@@ -4307,26 +4307,6 @@ UserSchema.statics.getDownline = async function (
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
UserSchema.statics.fixUsername = async function (idapp, aportador_solidario_ind_order, username) {
|
||||
const User = this;
|
||||
|
||||
// Check if somewhere there is my username
|
||||
return User.find({ idapp, aportador_solidario_ind_order }, async (err, arrrec) => {
|
||||
if (arrrec) {
|
||||
for (const myuser of arrrec) {
|
||||
if (!myuser.aportador_solidario || myuser.aportador_solidario === tools.APORTADOR_NONE) {
|
||||
myuser.aportador_solidario = username;
|
||||
await myuser.save()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
UserSchema.statics.findByCellAndNameSurname = function (
|
||||
idapp, cell, name, surname) {
|
||||
const User = this;
|
||||
@@ -6324,9 +6304,10 @@ UserSchema.statics.createNewSubRecord = async function (idapp, req) {
|
||||
|
||||
const User = mongoose.model('User', UserSchema);
|
||||
|
||||
User.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
User.createIndexes()
|
||||
.then(() => { })
|
||||
.catch((err) => { throw err; });
|
||||
|
||||
|
||||
class Hero {
|
||||
constructor(name, level) {
|
||||
|
||||
Reference in New Issue
Block a user