mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-06 15:03:08 -05:00
refactor: use process.env in node environments (#51110)
This commit is contained in:
committed by
GitHub
parent
c2fff83d41
commit
5f475cefa6
@@ -16,7 +16,6 @@ import uuid from 'uuid/v4';
|
||||
import { isEmail } from 'validator';
|
||||
|
||||
import { blocklistedUsernames } from '../../../../config/constants';
|
||||
import { apiLocation } from '../../../../config/env.json';
|
||||
|
||||
import { wrapHandledError } from '../../server/utils/create-handled-error.js';
|
||||
import {
|
||||
@@ -202,7 +201,7 @@ export default function initializeUser(User) {
|
||||
exists => {
|
||||
if (exists) {
|
||||
throw wrapHandledError(new Error('user already exists'), {
|
||||
redirectTo: `${apiLocation}/signin`,
|
||||
redirectTo: `${process.env.API_LOCATION}/signin`,
|
||||
message: dedent`
|
||||
The ${user.email} email address is already associated with an account.
|
||||
Try signing in with it here instead.
|
||||
@@ -502,7 +501,7 @@ export default function initializeUser(User) {
|
||||
}
|
||||
const { id: loginToken, created: emailAuthLinkTTL } = token;
|
||||
const loginEmail = getEncodedEmail(newEmail ? newEmail : null);
|
||||
const host = apiLocation;
|
||||
const host = process.env.API_LOCATION;
|
||||
const mailOptions = {
|
||||
type: 'email',
|
||||
to: newEmail ? newEmail : this.email,
|
||||
|
||||
Reference in New Issue
Block a user