Skip to content
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

Cannot get value of Headers in passport authenticate #8

Open
pratiksha2012 opened this issue Jul 24, 2018 · 0 comments
Open

Cannot get value of Headers in passport authenticate #8

pratiksha2012 opened this issue Jul 24, 2018 · 0 comments

Comments

@pratiksha2012
Copy link

I need to get value in req.headers either of the two.
On hitting route '/auth/fitbit' the value i get in headers should be same in all consoles.

app.get('/auth/fitbit', function(req,res,next){
console.log("console 1",req.headers)
next();
},
passport.authenticate('fitbit', {
scope: ['activity','heartrate','location','profile'],prompt:"login" })
);

app.get('/auth/fitbit/callback',
passport.authenticate('fitbit', { failureRedirect: '/login' }),
function(req, res) {
console.log("console 2 ",req.headers)
// Successful authentication, redirect home.
res.redirect('https://www.google.com');
});

passport.use(new FitbitStrategy({
clientID: "clientID",
clientSecret: "clientSecret",
scope: ['activity', 'heartrate', 'location', 'profile'],
callbackURL: "callbackURL",
},
function (req, accessToken, refreshToken, profile, done) {
console.log("console 3",req.headers);
process.nextTick(function () {
})
})
))

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

1 participant