Ajout test lors de la validation du compte pour vérifier si le code parrain saisi ne correspondant n'est pas à celui de l'utilisateur lui-même...

This commit is contained in:
Fabrice PENHOËT 2020-11-10 16:47:08 +01:00
parent 1d3f30842e
commit a0ccbffe59
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ exports.signUpCompletion = async (req, res, next) =>
if(req.body.codeGodfather !== "")
{
const godfather=await searchIdGodfather(req.body.codeGodfather);
if(godfather)
if(godfather && godfather.id !== req.connectedUser.User.id) // des fois qu'il se serait désigné lui-même comme "parrain" :)
req.body.GodfatherId=godfather.id;
}
await Promise.all([