Skip to content

Cannot get value of Headers in passport authenticate #8

@pratiksha2012

Description

@pratiksha2012

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 () {
})
})
))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions