Created
September 16, 2017 16:04
-
-
Save ivanvs/93bf31079e9fa1673e3807867f2b3ab4 to your computer and use it in GitHub Desktop.
React example how to do authenitcation with Twitter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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