mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-13 13:00:27 -05:00
refactor: stop sharing api/client specific config (#51423)
This commit is contained in:
committed by
GitHub
parent
2428910ad1
commit
cb9d6a6243
@@ -4,7 +4,7 @@ import jwt from 'jsonwebtoken';
|
||||
import passport from 'passport';
|
||||
import fetch from 'node-fetch';
|
||||
import { isEmail } from 'validator';
|
||||
import { jwtSecret } from '../../../../config/secrets';
|
||||
import { jwtSecret } from '../../../config/secrets';
|
||||
import { decodeEmail } from '../../common/utils';
|
||||
import {
|
||||
createPassportCallbackAuthenticator,
|
||||
|
||||
@@ -16,7 +16,7 @@ import isURL from 'validator/lib/isURL';
|
||||
import fetch from 'node-fetch';
|
||||
import jwt from 'jsonwebtoken';
|
||||
|
||||
import { jwtSecret } from '../../../../config/secrets';
|
||||
import { jwtSecret } from '../../../config/secrets';
|
||||
import { challengeTypes } from '../../../../config/challenge-types';
|
||||
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,7 @@ import debug from 'debug';
|
||||
import Stripe from 'stripe';
|
||||
|
||||
import { donationSubscriptionConfig } from '../../../../config/donation-settings';
|
||||
import keys from '../../../../config/secrets';
|
||||
import keys from '../../../config/secrets';
|
||||
import {
|
||||
getAsyncPaypalToken,
|
||||
verifyWebHook,
|
||||
|
||||
@@ -3,7 +3,7 @@ import dedent from 'dedent';
|
||||
import passport from 'passport';
|
||||
|
||||
import { availableLangs } from '../../../config/i18n';
|
||||
import { jwtSecret } from '../../../config/secrets';
|
||||
import { jwtSecret } from '../../config/secrets';
|
||||
import passportProviders from './passport-providers';
|
||||
import { setAccessTokenToResponse } from './utils/getSetAccessToken';
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var secrets = require('../../../config/secrets');
|
||||
var secrets = require('../../config/secrets');
|
||||
|
||||
module.exports = {
|
||||
db: {
|
||||
|
||||
@@ -9,7 +9,7 @@ const loopback = require('loopback');
|
||||
const boot = require('loopback-boot');
|
||||
const morgan = require('morgan');
|
||||
|
||||
const { sentry } = require('../../../config/secrets');
|
||||
const { sentry } = require('../../config/secrets');
|
||||
const { setupPassport } = require('./component-passport');
|
||||
|
||||
const log = createDebugger('fcc:server');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { allowedOrigins } from '../../../../config/cors-settings';
|
||||
import { allowedOrigins } from '../../../config/cors-settings';
|
||||
|
||||
export default function constantHeaders() {
|
||||
return function (req, res, next) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
import { jwtSecret as _jwtSecret } from '../../../../config/secrets';
|
||||
import { jwtSecret as _jwtSecret } from '../../../config/secrets';
|
||||
|
||||
import { wrapHandledError } from '../utils/create-handled-error';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Handlers, captureException } from '@sentry/node';
|
||||
import { sentry } from '../../../../config/secrets';
|
||||
import { sentry } from '../../../config/secrets';
|
||||
import { isHandledError } from '../utils/create-handled-error';
|
||||
|
||||
// sends directly to Sentry
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Handlers } from '@sentry/node';
|
||||
import { sentry } from '../../../../config/secrets';
|
||||
import { sentry } from '../../../config/secrets';
|
||||
|
||||
export default function sentryRequestHandler() {
|
||||
return sentry.dsn === 'dsn_from_sentry_dashboard'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Handlers } from '@sentry/node';
|
||||
import { sentry } from '../../../../config/secrets';
|
||||
import { sentry } from '../../../config/secrets';
|
||||
|
||||
export default function sentryRequestHandler() {
|
||||
return sentry.dsn === 'dsn_from_sentry_dashboard'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import debugFactory from 'debug';
|
||||
const log = debugFactory('fcc:boot:user');
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { jwtSecret } from '../../../../config/secrets';
|
||||
import { jwtSecret } from '../../../config/secrets';
|
||||
|
||||
/*
|
||||
* User tokens for submitting external curriculum are deleted when they sign
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { auth0 } from '../../../config/secrets';
|
||||
import { auth0 } from '../../config/secrets';
|
||||
|
||||
const { clientID, clientSecret, domain } = auth0;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import axios from 'axios';
|
||||
import debug from 'debug';
|
||||
import isEmail from 'validator/lib/isEmail';
|
||||
import { donationSubscriptionConfig } from '../../../../config/donation-settings';
|
||||
import keys from '../../../../config/secrets';
|
||||
import keys from '../../../config/secrets';
|
||||
|
||||
const log = debug('fcc:boot:donate');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable camelcase */
|
||||
import axios from 'axios';
|
||||
import keys from '../../../../config/secrets';
|
||||
import keys from '../../../config/secrets';
|
||||
import {
|
||||
mockApp,
|
||||
createDonationMockFn,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { isBefore } from 'date-fns';
|
||||
import jwt from 'jsonwebtoken';
|
||||
|
||||
import { jwtSecret as _jwtSecret } from '../../../../config/secrets';
|
||||
import { jwtSecret as _jwtSecret } from '../../../config/secrets';
|
||||
|
||||
export const jwtCookieNS = 'jwt_access_token';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const jwt = require('jsonwebtoken');
|
||||
const { allowedOrigins } = require('../../../../config/cors-settings');
|
||||
const { allowedOrigins } = require('../../../config/cors-settings');
|
||||
// process.env.HOME_LOCATION is being used as a fallback here. If the one
|
||||
// provided by the client is invalid we default to this.
|
||||
const { availableLangs } = require('../../../../config/i18n');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { uniqBy } from 'lodash';
|
||||
import { jwtSecret } from '../../../config/secrets';
|
||||
import { jwtSecret } from '../../../api-server/config/secrets';
|
||||
import { getChallenges } from '../utils/get-challenges';
|
||||
import { updateUserChallengeData } from '../utils/common-challenge-functions';
|
||||
import { formatValidationError } from '../utils/error-formatting';
|
||||
|
||||
5
client/config/analytics-settings.ts
Normal file
5
client/config/analytics-settings.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const prodAnalyticsId = 'GTM-57R6KJM';
|
||||
export const devAnalyticsId = 'GTM-WSS47LM';
|
||||
|
||||
// this id includes a stream for the spanish learn platform
|
||||
export const prodAnalyticsESId = 'GTM-KCS6GSD';
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
devAnalyticsId,
|
||||
prodAnalyticsId,
|
||||
prodAnalyticsESId
|
||||
} from '../../../config/analytics-settings';
|
||||
} from '../../config/analytics-settings';
|
||||
|
||||
import envData from '../../../config/env.json';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { useMediaQuery } from 'react-responsive';
|
||||
import { isLanding } from '../../../utils/path-parsers';
|
||||
import { Link, SkeletonSprite } from '../../helpers';
|
||||
import { SEARCH_EXPOSED_WIDTH } from '../../../../../config/misc';
|
||||
import { SEARCH_EXPOSED_WIDTH } from '../../../../config/misc';
|
||||
import MenuButton from './menu-button';
|
||||
import NavLinks, { type NavLinksProps } from './nav-links';
|
||||
import NavLogo from './nav-logo';
|
||||
|
||||
@@ -10,7 +10,7 @@ import GreenPass from '../../../assets/icons/green-pass';
|
||||
import { randomCompliment } from '../../../../src/utils/get-words';
|
||||
import Help from '../../../assets/icons/help';
|
||||
import Reset from '../../../assets/icons/reset';
|
||||
import { MAX_MOBILE_WIDTH } from '../../../../../config/misc';
|
||||
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
|
||||
import { apiLocation } from '../../../../../config/env.json';
|
||||
import { ChallengeMeta } from '../../../redux/prop-types';
|
||||
import { Share } from '../../../components/share';
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
showPreviewPortalSelector,
|
||||
showPreviewPaneSelector
|
||||
} from '../redux/selectors';
|
||||
import { TOOL_PANEL_HEIGHT } from '../../../../../config/misc';
|
||||
import { TOOL_PANEL_HEIGHT } from '../../../../config/misc';
|
||||
import ToolPanel from '../components/tool-panel';
|
||||
import PreviewPortal from '../components/preview-portal';
|
||||
import EditorTabs from './editor-tabs';
|
||||
|
||||
@@ -11,7 +11,7 @@ import store from 'store';
|
||||
import { editor } from 'monaco-editor';
|
||||
import { challengeTypes } from '../../../../../config/challenge-types';
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
import { MAX_MOBILE_WIDTH } from '../../../../../config/misc';
|
||||
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
|
||||
|
||||
import {
|
||||
ChallengeFiles,
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
isAdvancingToChallengeSelector,
|
||||
chapterSlugSelector
|
||||
} from '../redux/selectors';
|
||||
import { MAX_MOBILE_WIDTH } from '../../../../../config/misc';
|
||||
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
|
||||
|
||||
interface PreviewPortalProps {
|
||||
children: ReactElement | null;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
exports.prodAnalyticsId = 'GTM-57R6KJM';
|
||||
exports.devAnalyticsId = 'GTM-WSS47LM';
|
||||
|
||||
// this id includes a stream for the spanish learn platform
|
||||
exports.prodAnalyticsESId = 'GTM-KCS6GSD';
|
||||
Reference in New Issue
Block a user