0
I am using the Passport with Session and need to get the user id of a session. I tried to use:
router.get('/', (req, res) =>{
execSQLQuery('SELECT * FROM users WHERE id=' + req.user.id, res);
})
Error:
Cannot read property 'id' of undefined
would not be
req.params.id
? from what I understand Oce is passing the id through the url parameter.– Cmte Cardeal
Actually I’d like to pick up by the session, I tried to do using the rarameter by the url but it’s not viable for application. But thank you for correcting the question.
– Igor Gabriel