Open sukeerthimogallapalli opened 5 years ago
Want to leave a note here for future users-- Looks like setting the field
state = true
breaks functionality and therefore will always redirect to failureUrl
I can verify this behavior. We have to set state=false
to make it work.
Yes any solution??
Hi everyone, I define 2 { successRedirect: '/', failureRedirect: '/login', }. When I press Allow button and then my page redirect failureRedirect's url (/login). Why ?
router.get('/auth/linkedin/callback', passportLinkedIn.authenticate('linkedin', { successRedirect: '/', failureRedirect: '/login' }), (error, req, res, next) => { console.log() }) passport.use(new LinkedInStrategy({ clientID: config.linkedin.clientID, clientSecret: config.linkedin.clientSecret, callbackURL: config.linkedin.callbackURL, profileFields: [ "first-name", "last-name", "email-address", "headline", "summary", "industry", "picture-url", "positions", "public-profile-url", "location" ], scope: ['r_basicprofile', 'r_emailaddress'], state: true, passReqToCallback: true }, function (req, accessToken, refreshToken, profile, done) { console.log('profile---------------------------------------------------------------------------------------------------') process.nextTick(function () { return done(null, profile); }) }))