Skip to content

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