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.
@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