Skip to content

Commit

Permalink
Merge pull request #61 from andela/fix-social-media-login-166194818
Browse files Browse the repository at this point in the history
Fix bug: Social media
  • Loading branch information
nakiwuge committed May 30, 2019
2 parents bb080b4 + 640b553 commit e45ab3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
8 changes: 2 additions & 6 deletions middlewares/passport-facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ import dotenv from 'dotenv';

// @dotenv configuration
dotenv.config();
const {
FACEBOOK_APP_ID,
FACEBOOK_APP_SECRET,
APP_URL
} = process.env;
const { FACEBOOK_APP_ID, FACEBOOK_APP_SECRET, APP_URL } = process.env;

const fbStrategy = new FacebookTokenStrategy(
{
callbackURL: `${APP_URL}/api/users/login/facebook/redirect`,
callbackURL: `${APP_URL}api/users/login/facebook/redirect`,
clientID: FACEBOOK_APP_ID,
clientSecret: FACEBOOK_APP_SECRET,
profileFields: ['id', 'displayName', 'photos', 'email']
Expand Down
5 changes: 3 additions & 2 deletions middlewares/passport-google.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ const googleStrategy = new GoogleStrategy(
{
clientID: GOOGLE_CLIENT_ID,
clientSecret: GOOGLE_CLIENT_SECRET,
callbackURL: `${APP_URL}/api/users/login/google/redirect`,
callbackURL: `${APP_URL}api/users/login/google/redirect`,
profileFields: ['id', 'displayName', 'photos', 'email']
}, (accessToken, refreshToken, profile, done) => {
},
(accessToken, refreshToken, profile, done) => {
const userGoogle = {
username: profile.displayName,
isActivated: true
Expand Down
2 changes: 1 addition & 1 deletion middlewares/passport-twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const twStrategy = new twitterStrategy(
{
consumerKey: TWITTER_CONSUMER_KEY,
consumerSecret: TWITTER_CONSUMER_SECRET,
callbackURL: `${APP_URL}/api/users/login/twitter/redirect`
callbackURL: `${APP_URL}api/users/login/twitter/redirect`
},
(token, tokenSecret, profile, done) => {
const userTwitter = {
Expand Down

0 comments on commit e45ab3d

Please sign in to comment.