Wednesday 18 April 2018

`user`(variable) is not defined while rendering ejs file

the repo: https://ift.tt/2H9hxEg trying/practicing to create a simple blog site and in the procedure. I've created the passport js login with Net Ninja, and now I have also tried practicing it for the 2nd time. and then I am trying to render the profile.ejs if you look at the code in profile routes you will be able to see what I'm trying to do.Like if the user is logged in only then the profile.ejs will be rendered otherwise it would be redirected to the login page.But somehow there is some error popping up in the profile.ejs file where I've called in the user from the route in { user: req.user } but it doesn't seem to get any user. the error always comes up as user is not definedI'm really looking forward to this blogsite 'cause as you said after practicing I feel pretty confident that I would be able to complete this on my own. But somehow I'm again that stupid

Submitted April 18, 2018 at 06:55PM by tapu_buoy

No comments:

Post a Comment