Skip to content

Instantly share code, notes, and snippets.

@ivanvs
Created September 16, 2017 16:04
Show Gist options
  • Select an option

  • Save ivanvs/93bf31079e9fa1673e3807867f2b3ab4 to your computer and use it in GitHub Desktop.

Select an option

Save ivanvs/93bf31079e9fa1673e3807867f2b3ab4 to your computer and use it in GitHub Desktop.
React example how to do authenitcation with Twitter
//token handling middleware
var authenticate = expressJwt({
secret: 'my-secret',
requestProperty: 'auth',
getToken: function(req) {
if (req.headers['x-auth-token']) {
return req.headers['x-auth-token'];
}
return null;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment