Skip to content

questions: page redirect after successful social (i.e. facebook) login #362

@footloosemoose

Description

@footloosemoose

Hi everyone (my first post here - thanks to all for the excellent work)

I'm having trouble redirecting to a dashboard page ('/me') after a successful facebook login.

I have tried setting the 'successRedirect' option in the passport.authenticate method with no luck.

// not working for me...
.get('/', passport.authenticate('facebook', {
    successRedirect: '/me',
    failureRedirect: '/signup',
    session: false
  }))

I have also tried updating the authCallback function in user.controller.js with

// not working for me...
exports.authCallback = function(req, res, next) {
  res.redirect('/me');
};

All attempts so far just dump me out back at '/'.

I'm wondering if it has something to do with the catch-all in the routes?

// All other routes should redirect to the index.html
  app.route('/*')
    .get(function(req, res) {
      res.sendfile(app.get('appPath') + '/index.html');
    });

No doubt this is something I'm overlooking. Any help would be very much appreciated.

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