From a0ccbffe5945c2d0ce1b566764c8d3e71c40421e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20PENHO=C3=8BT?= Date: Tue, 10 Nov 2020 16:47:08 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20test=20lors=20de=20la=20validation=20du?= =?UTF-8?q?=20compte=20pour=20v=C3=A9rifier=20si=20le=20code=20parrain=20s?= =?UTF-8?q?aisi=20ne=20correspondant=20n'est=20pas=20=C3=A0=20celui=20de?= =?UTF-8?q?=20l'utilisateur=20lui-m=C3=AAme...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/user.js b/controllers/user.js index eb20c91..0750574 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -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([