bradtraversy / node_passport_login

Node.js login, registration and access control using Express and Passport
1.73k stars 1.3k forks source link

ReferenceError: newUser is not defined #90

Closed SkyphosMC closed 3 years ago

SkyphosMC commented 3 years ago

I am roughly 47 minutes into the Node.js With Passport Authentication | Full Project YouTube tutorial and I am having an issue with console.log(newUser). Instead of repeating the details entered into the website into the console like it does in the video it gives me a ReferenceError that newUser is not definded.

ReferenceError: newUser is not defined at C:\xampp\htdocs\node_passport_login\routes\users.js:65:25 at Layer.handle [as handle_request] (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\layer.js:95:5) at next (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\layer.js:95:5) at C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:335:12) at next (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:275:10) at Function.handle (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:174:3) at router (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:47:12) at Layer.handle [as handle_request] (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:317:13) at C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:335:12) at next (C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:275:10) at C:\xampp\htdocs\node_passport_login\node_modules\express\lib\router\index.js:635:15

I have attached my routes/users.js to this issue. users.zip

SkyphosMC commented 3 years ago

I accidently put the newUser variable outside the else statement.