Skip to content

NodeChat , very simple authentication : undefined error #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yabetse opened this issue Jul 19, 2017 · 2 comments
Closed

NodeChat , very simple authentication : undefined error #2

yabetse opened this issue Jul 19, 2017 · 2 comments

Comments

@yabetse
Copy link

yabetse commented Jul 19, 2017

On page 36 ( very simple authentication),
module.exports.authenticated .... Returns this error. Caused by this assignment statement

res.locals.isAuthenticated = req.session.isAuthenticated;

TypeError: Cannot read property 'locals' of undefined at Object.authenticated ....

I tried res.app.locals instead but that didn't work too. How do i fix 👆

@echeadle
Copy link

Did you add in the code past page 36? I don't remember many additional functions you need to add past page 36 for things to work, but try putting in the code down through page 38 where it says add in the loginProcess function in index.js. I think it should work after that.

@johanan
Copy link
Owner

johanan commented Aug 23, 2017

@yabetse, sorry for taking so long. It is easy to get distracted and then a month goes by. I pulled down the code, ran npm install, and then node app.js. I ran into a similar problem that you did. The problem I had was that Redis was not running. I just used Docker to create an instance and everything worked how it should have.

@johanan johanan closed this as completed Aug 23, 2017
johanan added a commit that referenced this issue Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants