Add dev urls

master
Ian Mancini 4 years ago
parent 0b2fb528b2
commit 8a15a8c57e

@ -6,6 +6,7 @@ REDIS_PASSWORD=
SESSION_SECRET= SESSION_SECRET=
HOST= HOST=
HOST_DEV=
FACEBOOK_CLIENT_ID= FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET= FACEBOOK_CLIENT_SECRET=

@ -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'],
} }

@ -5,10 +5,16 @@ import passport from 'passport'
import genericStrategy from '../strategy' import genericStrategy from '../strategy'
const redirectPath = 'auth/google/redirect'
const callbackURL =
process.env.NODE_ENV !== 'production'
? `${process.env.HOST_DEV}/${redirectPath}`
: `${process.env.HOST}/${redirectPath}`
const strategyOptions = { const strategyOptions = {
clientID: process.env.GOOGLE_CLIENT_ID, clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET, clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: `${process.env.HOST}/auth/google/redirect` ?? '/auth/google/redirect', callbackURL: callbackURL,
} }
export function googleStrategy() { export function googleStrategy() {

@ -5,10 +5,16 @@ import passport from 'passport'
import genericStrategy from '../strategy' import genericStrategy from '../strategy'
const redirectPath = 'auth/twitter/redirect'
const callbackURL =
process.env.NODE_ENV !== 'production'
? `${process.env.HOST_DEV}/${redirectPath}`
: `${process.env.HOST}/${redirectPath}`
const strategyOptions = { const strategyOptions = {
consumerKey: process.env.TWITTER_CONSUMER_KEY, consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET, consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
callbackURL: `${process.env.HOST}/auth/twitter/redirect` ?? '/auth/twitter/redirect', callbackURL: callbackURL,
includeEmail: true, includeEmail: true,
} }

Loading…
Cancel
Save