iamshaunjp / oauth-playlist

304 stars 251 forks source link

username not defined in profile-routes.js #5

Open bhanuka96 opened 6 years ago

prabuselvan commented 6 years ago

@iamshaunjp @bhanuka96

Hi Guys,

router.get('/google/redirect',passport.authenticate('google'),(req,res)=> { // res.send('You Reached the Callback URI'); // res.send(req.user) // res.redirect('/profile/'); const uname = req.user.username; console.log('Username is ', uname); res.status(200).send(uname + ' Hey You are Logged in Welcome to My Site '); });

The above code is working fine. When I route the profile to another file profile-routes.js then it is not working(username not defined error I am getting). Please have a look.

Thanks Prabu

suhanichawla commented 4 years ago

@prabuselvan could you solve this issue? I'm also stuck on this.