Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 897 Bytes

README.md

File metadata and controls

39 lines (28 loc) · 897 Bytes

consulate-twitter

Twitter exchange plugin for consulate.

consulate-twitter allows users to login/register with Twitter and exchange a Twitter access_token for a consulate authorization code.

Usage

Just register consulate-twitter as a plugin with your consulate server:

var consulate = require('consulate')
  , twitter = require('consulate-twitter');

var app = consulate();

app.plugin(twitter({
  consumerKey: 'MY_TWITTER_CONSUMER_KEY',
  consumerSecret: 'MY_TWITTER_CONSUMER_SECRET',
  callbackURL: 'MY_TWITTER_CALLBACK_URL'
}, function(accessToken, refreshToken, profile, done) {

  // lookup user by twitter id here. if they don't exist create them
  ...

  // Return the user for your consulate system
  done(null, myUser);
}));

Tests

$ npm test