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

Added Foursquare as a supported auth strategy. #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martindale
Copy link

This should fix #90. The following is the configuration I used:

    foursquare: {
      everyauth: {
          appId: conf.foursquare.secrets.clientId
        , appSecret: conf.foursquare.secrets.clientSecret
        , findOrCreateUser: function(sess, accessTok, accessTokSecret, foursquareUser) {
            var promise = this.Promise()
              , self = this;

            if (typeof(sess.auth) != 'undefined') {

              User.findById(sess.auth.userId, function (err, user) {
                if (err) return promise.fail(err);
                if (!user) {
                  return promise.fail('no user in twitter auth');
                } else {
                  assignFoursquareDataToUser(user, accessTok, accessTokSecret, foursquareUser);

                  // Save the new data to the user doc in the db
                  user.save( function (err, user) {
                    if (err) return promise.fail(err);
                    promise.fulfill(user);
                  });
                }
              });          
            } else {
              return promise.fail('no user');
            }

            return promise;
          }
        , redirectPath: '/'
      }
    }

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

Successfully merging this pull request may close these issues.

Does not support foursquare
1 participant