mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
Merge branch 'new-queue' of github.com:coralproject/talk into new-queue
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
const FacebookStrategy = require('passport-facebook').Strategy;
|
||||
const UsersService = require('services/users');
|
||||
const {ValidateUserLogin} = require('services/passport');
|
||||
let {
|
||||
ROOT_URL
|
||||
} = require('config');
|
||||
|
||||
if (ROOT_URL[ROOT_URL.length - 1] !== '/') {
|
||||
ROOT_URL += '/';
|
||||
}
|
||||
|
||||
module.exports = (passport) => {
|
||||
if (process.env.TALK_FACEBOOK_APP_ID && process.env.TALK_FACEBOOK_APP_SECRET && process.env.TALK_ROOT_URL) {
|
||||
passport.use(new FacebookStrategy({
|
||||
clientID: process.env.TALK_FACEBOOK_APP_ID,
|
||||
clientSecret: process.env.TALK_FACEBOOK_APP_SECRET,
|
||||
callbackURL: `${process.env.TALK_ROOT_URL}/api/v1/auth/facebook/callback`,
|
||||
callbackURL: `${ROOT_URL}api/v1/auth/facebook/callback`,
|
||||
passReqToCallback: true,
|
||||
profileFields: ['id', 'displayName', 'picture.type(large)']
|
||||
}, async (req, accessToken, refreshToken, profile, done) => {
|
||||
|
||||
Reference in New Issue
Block a user