madhums / node-express-mongoose-demo

A simple demo app using node and mongodb for beginners (with docker)
https://nodejs-express-demo.fly.dev
MIT License
5.12k stars 1.38k forks source link

TypeError: Cannot read property 'clientID' of undefined #143

Closed 0532 closed 9 years ago

0532 commented 9 years ago

i run node sever.js

D:\ProjectSpace\nodespace\node-express-mongoose-demo>node server.js
WARNING: No configurations found in configuration directory:
WARNING: D:\ProjectSpace\nodespace\node-express-mongoose-demo\config
WARNING: See https://www.npmjs.org/package/config for more information.

D:\ProjectSpace\nodespace\node-express-mongoose-demo\config\passport\google.js:1
6
    clientID: config.google.clientID,
                           ^
TypeError: Cannot read property 'clientID' of undefined
    at Object.<anonymous> (D:\ProjectSpace\nodespace\node-express-mongoose-demo\
config\passport\google.js:16:28)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (D:\ProjectSpace\nodespace\node-express-mongoose-demo\
config\passport.js:11:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

system win7 thx

chinmayrane commented 9 years ago

You have to register a dummy app on Google App Console and use the provided client Id and Client Secret in

config/env/

Whichever Environment you've set up to Dev / Test / Production.

When setting up the Google App console, they'll also ask for a Callback URL,

You can set it to http://localhost:3000/auth/google/callback for development purposes or if you have a dedicated hosted website, you can use the website name instead of the localhost:3000

Cheers,

madhums commented 9 years ago

thanks @chinmayrane