You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sup_File/auth/github.js

17 lines
572 B
JavaScript

var passport = require('passport');
var GitHubStrategy = require('passport-github').Strategy;
passport.use(new GitHubStrategy({
clientID: "60a0296da9fce6ca3b7e",
clientSecret: "9fb2f52123d9d840c98b98b3b4ffbc5dd77d1de3",
callbackURL: "https://localhost:3000/api/github/callback"
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate({userid: profile.id}, {name: profile.displayName,userid: profile.id}, function (err, user) {
return done(err, user);
});
}
));
module.exports = passport;