|
|
@ -1,6 +1,4 @@
|
|
|
|
import path from 'path'
|
|
|
|
import path from 'path'
|
|
|
|
import dotenv from 'dotenv'
|
|
|
|
|
|
|
|
dotenv.config({ path: path.join(__dirname, '../../../.env') })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { Strategy } from 'passport-facebook'
|
|
|
|
import { Strategy } from 'passport-facebook'
|
|
|
|
|
|
|
|
|
|
|
@ -9,10 +7,16 @@ import passport from 'passport'
|
|
|
|
|
|
|
|
|
|
|
|
import genericStrategy from '../strategy'
|
|
|
|
import genericStrategy from '../strategy'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const redirectPath = 'auth/facebook/redirect'
|
|
|
|
|
|
|
|
const callbackURL =
|
|
|
|
|
|
|
|
process.env.NODE_ENV !== 'production'
|
|
|
|
|
|
|
|
? `${process.env.HOST_DEV}/${redirectPath}`
|
|
|
|
|
|
|
|
: `${process.env.HOST}/${redirectPath}`
|
|
|
|
|
|
|
|
|
|
|
|
const strategyOptions = {
|
|
|
|
const strategyOptions = {
|
|
|
|
clientID: process.env.FACEBOOK_CLIENT_ID,
|
|
|
|
clientID: process.env.FACEBOOK_CLIENT_ID,
|
|
|
|
clientSecret: process.env.FACEBOOK_CLIENT_SECRET,
|
|
|
|
clientSecret: process.env.FACEBOOK_CLIENT_SECRET,
|
|
|
|
callbackURL: `${process.env.HOST}/auth/facebook/redirect` ?? '/auth/facebook/redirect',
|
|
|
|
callbackURL: callbackURL,
|
|
|
|
profileFields: ['id', 'displayName', 'picture.type(large)', 'email'],
|
|
|
|
profileFields: ['id', 'displayName', 'picture.type(large)', 'email'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|