Added github login strategy

This commit is contained in:
Sahat Yalkabov
2013-12-03 17:38:14 -05:00
parent 188539d4fe
commit af32d85a2b
2 changed files with 14 additions and 0 deletions

View File

@ -63,6 +63,19 @@ passport.use(new FacebookStrategy({
}
));
// GITHUB OAUTH2 LOGIN
passport.use(new GitHubStrategy({
clientID: GITHUB_CLIENT_ID,
clientSecret: GITHUB_CLIENT_SECRET,
callbackURL: "http://127.0.0.1:3000/auth/github/callback"
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate({ githubId: profile.id }, function (err, user) {
return done(err, user);
});
}
));
// TWITTER OAUTH2 LOGIN
passport.use(new TwitterStrategy({
consumerKey: config.twitter.clientId,

View File

@ -13,6 +13,7 @@
"node-foursquare": "*",
"passport": "*",
"passport-local": "*",
"passport-github": "*",
"passport-facebook": "*",
"passport-twitter": "*",
"passport-google-oauth": "*",