diff --git a/common/models/user.js b/common/models/user.js index b3291b773b..b8681c2553 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -17,7 +17,7 @@ import _ from 'lodash'; import jwt from 'jsonwebtoken'; import generate from 'nanoid/generate'; -import { homeLocation } from '../../config/env'; +import { homeLocation, apiLocation } from '../../config/env'; import { fixCompletedChallengeItem } from '../utils'; import { themes } from '../utils/themes'; @@ -596,7 +596,7 @@ module.exports = function(User) { } const { id: loginToken, created: emailAuthLinkTTL } = token; const loginEmail = this.getEncodedEmail(newEmail ? newEmail : null); - const host = homeLocation; + const host = apiLocation; const mailOptions = { type: 'email', to: newEmail ? newEmail : this.email, diff --git a/config/env.js b/config/env.js index d0833ae121..f80e542755 100644 --- a/config/env.js +++ b/config/env.js @@ -1,3 +1,4 @@ module.exports = { - homeLocation: process.env.HOME_LOCATION + homeLocation: process.env.HOME_LOCATION, + apiLocation: process.env.API_LOCATION }; diff --git a/sample.env b/sample.env index 63828aab11..0a92bf5ff5 100644 --- a/sample.env +++ b/sample.env @@ -20,3 +20,4 @@ DEBUG=true IMAGE_BASE_URL='https://s3.amazonaws.com/freecodecamp/images/' HOME_LOCATION='http://localhost:8000' +API_LOCATION='http://localhost:3000'