1

This question have been posted before, but somehow the given recommendations don't work form me. Am stuck on this and not sure how to proceed.

I can't redirect the user back after its authentication. I'm using the recommended 'successReturnToOrRedirect' property, but it keeps sending it back to '/'. I have checked req.session.returnTo and req.path and both of them have '/' as value, even though I'm calling /auth/facebook from a different page.

Here's my code:

 router.get('/auth/facebook', passport.authenticate('facebook', {scope: ['email', 'public_profile', 'user_friends']}));

router.get('/auth/facebook/callback', 

      passport.authenticate('facebook', { successReturnToOrRedirect: '/',
                                          failureRedirect: '/' })

    );

    <a href="/auth/facebook"> <div class="fb-button-login">
            <i class="fa fa-facebook" aria-hidden="true"></i>
            Continuar con <strong> facebook</strong>
        </div> </a>
A A
  • 70
  • 3
  • 11
  • 1
    I'm also having the same problem, `req.headers.referer` isn't present after the callback url gets called, so not sure what to do https://imgur.com/a/GEhL3 – Vlady Veselinov Oct 31 '17 at 02:32

0 Answers0