Saturday, 10 June 2017

Node.js and passport

I use node.js for server-side and passport for the authenticate.

I will to use the user id in my app.get (in the file route.js) for a sql request.

I have already tried req.params.id, req.user etc but nothing work. The sql request work when i put the user id for example 7 my error is where there are ????

connection.query("Select DISTINCT nom_marque, description, code_promo, promotion.id as promoId, type FROM marqueur, utilisateur, utilisateur_promotion, promotion, annonceur where utilisateur.id = '" ??????????"' and utilisateur.id = utilisateur_promotion.utilisateur_id and utilisateur_promotion.promotion_id = promotion.id and promotion.annonceur_id = annonceur.id and promotion.id = marqueur.promotion_id order by nom_marque.

And passport.js is the basic code from docs. Thanks a lot for your answers.



via Snuggy20

No comments:

Post a Comment