Added github login strategy
This commit is contained in:
@ -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,
|
||||
|
@ -13,6 +13,7 @@
|
||||
"node-foursquare": "*",
|
||||
"passport": "*",
|
||||
"passport-local": "*",
|
||||
"passport-github": "*",
|
||||
"passport-facebook": "*",
|
||||
"passport-twitter": "*",
|
||||
"passport-google-oauth": "*",
|
||||
|
Reference in New Issue
Block a user