/* global WIKI */// ------------------------------------// GitHub Account// ------------------------------------constGitHubStrategy=require('passport-github2').Strategyconst_=require('lodash')module.exports={init(passport,conf){passport.use('github',newGitHubStrategy({clientID:conf.clientId,clientSecret:conf.clientSecret,callbackURL:conf.callbackURL,scope:['user:email']},async(accessToken,refreshToken,profile,cb)=>{try{constuser=awaitWIKI.models.users.processProfile({profile:{...profile,picture:_.get(profile,'photos[0].value','')},providerKey:'github'})cb(null,user)}catch(err){cb(err,null)}}))}}