diff --git a/libs/model/src/config.ts b/libs/model/src/config.ts index 3979a15ac46..a2b64f89d77 100644 --- a/libs/model/src/config.ts +++ b/libs/model/src/config.ts @@ -1,4 +1,5 @@ import { configure, config as target } from '@hicommonwealth/core'; +import { S3_ASSET_BUCKET_CDN } from '@hicommonwealth/shared'; import { z } from 'zod'; const { @@ -48,8 +49,7 @@ const DEFAULTS = { ADDRESS_TOKEN_EXPIRES_IN: '10', PRIVATE_KEY: '', DATABASE_URL: `postgresql://commonwealth:edgeware@localhost/${NAME}`, - DEFAULT_COMMONWEALTH_LOGO: - 'https://s3.amazonaws.com/assets.commonwealth.im/common-white.png', + DEFAULT_COMMONWEALTH_LOGO: `https://s3.amazonaws.com/${S3_ASSET_BUCKET_CDN}/common-white.png`, MEMBERSHIP_REFRESH_BATCH_SIZE: '1000', MEMBERSHIP_REFRESH_TTL_SECONDS: '120', }; diff --git a/libs/model/src/utils/defaultAvatar.ts b/libs/model/src/utils/defaultAvatar.ts index dbf38d873e4..41c978dc784 100644 --- a/libs/model/src/utils/defaultAvatar.ts +++ b/libs/model/src/utils/defaultAvatar.ts @@ -1,10 +1,12 @@ +import { S3_ASSET_BUCKET_CDN } from '@hicommonwealth/shared'; + const defaultAvatars: string[] = [ - 'https://assets.commonwealth.im/fb3289b0-38cb-4883-908b-7af0c1626ece.png', - 'https://assets.commonwealth.im/794bb7a3-17d7-407a-b52e-2987501221b5.png', - 'https://assets.commonwealth.im/181e25ad-ce08-427d-8d3a-d290af3be44b.png', - 'https://assets.commonwealth.im/9f40b221-e2c7-4052-a7de-e580222baaa9.png', - 'https://assets.commonwealth.im/ef919936-8554-42e5-8590-118e8cb68101.png', - 'https://assets.commonwealth.im/0847e7f5-4d96-4406-8f30-c3082fa2f27c.png', + `https://${S3_ASSET_BUCKET_CDN}/fb3289b0-38cb-4883-908b-7af0c1626ece.png`, + `https://${S3_ASSET_BUCKET_CDN}/794bb7a3-17d7-407a-b52e-2987501221b5.png`, + `https://${S3_ASSET_BUCKET_CDN}/181e25ad-ce08-427d-8d3a-d290af3be44b.png`, + `https://${S3_ASSET_BUCKET_CDN}/9f40b221-e2c7-4052-a7de-e580222baaa9.png`, + `https://${S3_ASSET_BUCKET_CDN}/ef919936-8554-42e5-8590-118e8cb68101.png`, + `https://${S3_ASSET_BUCKET_CDN}/0847e7f5-4d96-4406-8f30-c3082fa2f27c.png`, ]; export function getRandomAvatar(): string { diff --git a/libs/model/src/webhook/util.ts b/libs/model/src/webhook/util.ts index 58eae45f809..1507e90f618 100644 --- a/libs/model/src/webhook/util.ts +++ b/libs/model/src/webhook/util.ts @@ -1,6 +1,6 @@ import { config } from '@hicommonwealth/model'; import { Community } from '@hicommonwealth/schemas'; -import { getDecodedString } from '@hicommonwealth/shared'; +import { getDecodedString, PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import z from 'zod'; export const REGEX_IMAGE = @@ -22,7 +22,7 @@ export function getPreviewImageUrl( if (community.icon_url) { const previewImageUrl = community.icon_url.match(`^(http|https)://`) ? community.icon_url - : `https://commonwealth.im${community.icon_url}`; + : `https://${PRODUCTION_DOMAIN}${community.icon_url}`; const previewImageAltText = `${community.name}`; return { previewImageUrl, previewImageAltText }; } diff --git a/libs/shared/src/utils.ts b/libs/shared/src/utils.ts index e077a7e3f35..638ca19b17e 100644 --- a/libs/shared/src/utils.ts +++ b/libs/shared/src/utils.ts @@ -5,7 +5,11 @@ import { decodeAddress, encodeAddress, } from '@polkadot/util-crypto'; -import { S3_ASSET_BUCKET_CDN, S3_RAW_ASSET_BUCKET_DOMAIN } from './constants'; +import { + PRODUCTION_DOMAIN, + S3_ASSET_BUCKET_CDN, + S3_RAW_ASSET_BUCKET_DOMAIN, +} from './constants'; /** * Decamelizes a string @@ -70,7 +74,7 @@ export const getThreadUrl = ( // - cannot use config util in libs/shared // - duplicate found in knock utils return process.env.NODE_ENV === 'production' - ? `https://commonwealth.im${relativePath}` + ? `https://${PRODUCTION_DOMAIN}${relativePath}` : `http://localhost:8080${relativePath}`; }; @@ -89,8 +93,8 @@ export function delay(ms: number): Promise { /** * Converts an S3 file URL from the raw bucket URL to the Cloudflare CDN format. * This is most often used in combination with pre-signed S3 upload URLs. - * Ex Input: https://s3.us-east-1.amazonaws.com/assets.commonwealth.im/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png - * Ex Output: https://assets.commonwealth.im/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png + * Ex Input: https://s3.us-east-1.amazonaws.com/${S3_ASSET_BUCKET_CDN}/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png + * Ex Output: https://${S3_ASSET_BUCKET_CDN}/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png */ export function formatBucketUrlToAssetCDN(uploadLocation: string) { if ( @@ -107,8 +111,8 @@ export function formatBucketUrlToAssetCDN(uploadLocation: string) { * Converts an S3 file URL from the CDN format to the raw assets bucket URL. * This function should only be used server side when the raw S3 headers are * required in the response (CloudFlare truncates headers). - * Ex Input: https://assets.commonwealth.im/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png - * Ex Output: https://s3.us-east-1.amazonaws.com/assets.commonwealth.im/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png + * Ex Input: https://${S3_ASSET_BUCKET_CDN}/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png + * Ex Output: https://s3.us-east-1.amazonaws.com/${S3_ASSET_BUCKET_CDN}/f2e44ed9-2fb4-4746-8d7a-4a60fcd83b77.png */ export function formatAssetUrlToS3(uploadLocation: string): string { if (uploadLocation.includes(S3_RAW_ASSET_BUCKET_DOMAIN)) { diff --git a/libs/shared/test/checkIconSize.spec.ts b/libs/shared/test/checkIconSize.spec.ts index dde939ddc64..f6a814a6b41 100644 --- a/libs/shared/test/checkIconSize.spec.ts +++ b/libs/shared/test/checkIconSize.spec.ts @@ -1,3 +1,4 @@ +import { S3_ASSET_BUCKET_CDN } from '@hicommonwealth/shared'; import { expect } from 'chai'; import { describe, test } from 'vitest'; import { getFileSizeBytes } from '../src/utils'; @@ -11,7 +12,7 @@ describe('checkIconSize', () => { // TODO: make this test not require a remote HTTP request? test('should return the image size', async () => { const fileSizeBytes = await getFileSizeBytes( - 'https://commonwealth-uploads.s3.us-east-2.amazonaws.com/bebbda6b-6b10-4cbd-8839-4fa8d2a0b266.jpg', + `https://${S3_ASSET_BUCKET_CDN}/bebbda6b-6b10-4cbd-8839-4fa8d2a0b266.jpg`, ); expect(fileSizeBytes).to.equal(14296); }); diff --git a/libs/sitemaps/src/createDatabasePaginator.ts b/libs/sitemaps/src/createDatabasePaginator.ts index 0451b82ae59..b1a468c8138 100644 --- a/libs/sitemaps/src/createDatabasePaginator.ts +++ b/libs/sitemaps/src/createDatabasePaginator.ts @@ -4,7 +4,7 @@ import { ThreadInstance, UserAttributes, } from '@hicommonwealth/model'; -import { getThreadUrl } from '@hicommonwealth/shared'; +import { getThreadUrl, PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { Op } from 'sequelize'; export interface Link { @@ -112,7 +112,7 @@ function createProfilesTableAdapter(): TableAdapter { return undefined; } - const url = `https://commonwealth.im/profile/id/${user.id}`; + const url = `https://${PRODUCTION_DOMAIN}/profile/id/${user.id}`; return { id: user.id, url, diff --git a/packages/commonwealth/client/scripts/navigation/helpers.tsx b/packages/commonwealth/client/scripts/navigation/helpers.tsx index 012e187af37..81853f3d766 100644 --- a/packages/commonwealth/client/scripts/navigation/helpers.tsx +++ b/packages/commonwealth/client/scripts/navigation/helpers.tsx @@ -1,3 +1,4 @@ +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import React from 'react'; import type { NavigateOptions, To } from 'react-router-dom'; import { @@ -9,8 +10,6 @@ import { import app from 'state'; import { fetchCachedCustomDomain } from 'state/api/configuration'; -const PROD_URL = 'https://commonwealth.im'; - type NavigateWithParamsProps = { to: string | ((params: Record) => string); }; @@ -116,7 +115,7 @@ export const navigateToCommunity = ({ navigate(path, {}, chain); } else { if (isExternalLink) { - window.open(`${PROD_URL}/${chain}${path}`); + window.open(`https://${PRODUCTION_DOMAIN}/${chain}${path}`); } else { navigate(path); } diff --git a/packages/commonwealth/client/scripts/views/Layout.tsx b/packages/commonwealth/client/scripts/views/Layout.tsx index bb31ee55615..9ea7b1b34b4 100644 --- a/packages/commonwealth/client/scripts/views/Layout.tsx +++ b/packages/commonwealth/client/scripts/views/Layout.tsx @@ -68,8 +68,8 @@ const LayoutComponent = ({ } }, [isAddedToHomeScreen, user.isOnPWA, user]); - // If community id was updated ex: `commonwealth.im/{community-id}/**/*` - // redirect to new community id ex: `commonwealth.im/{new-community-id}/**/*` + // If community id was updated ex: `${PRODUCTION_DOMAIN}/{community-id}/**/*` + // redirect to new community id ex: `${PRODUCTION_DOMAIN}/{new-community-id}/**/*` useNecessaryEffect(() => { // @ts-expect-error const redirectTo = configurationData?.redirects?.[providedCommunityScope]; diff --git a/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/constants.ts b/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/constants.ts index 0620037a4a9..c298df1d805 100644 --- a/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/constants.ts +++ b/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/constants.ts @@ -1,4 +1,5 @@ import { commonProtocol } from '@hicommonwealth/evm-protocols'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import NodeInfo from 'models/NodeInfo'; import { fetchCachedNodes } from 'state/api/nodes'; @@ -11,7 +12,7 @@ export const BLAST_ID = '81457'; const removeTestCosmosNodes = (nodeInfo: NodeInfo): boolean => { return !( - window.location.hostname.includes('commonwealth.im') && + window.location.hostname.includes(PRODUCTION_DOMAIN) && [ 'evmosdevci', 'csdkv1', diff --git a/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx b/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx index dc90a03c52e..ee08615d0d0 100644 --- a/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx +++ b/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx @@ -1,3 +1,4 @@ +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import 'Layout.scss'; import React from 'react'; import { Helmet } from 'react-helmet-async'; @@ -81,7 +82,7 @@ const defaultMeta = { }, 'twitter:image': { name: 'twitter:image', - content: 'https://commonwealth.im/img/brand_assets/common.png', + content: `https://${PRODUCTION_DOMAIN}/img/brand_assets/common.png`, }, 'og:type': { property: 'og:type', @@ -93,7 +94,7 @@ const defaultMeta = { }, 'og:url': { property: 'og:url', - content: 'https://commonwealth.im', + content: `https://${PRODUCTION_DOMAIN}`, }, 'og:title': { property: 'og:title', @@ -105,7 +106,7 @@ const defaultMeta = { }, 'og:image': { property: 'og:image', - content: 'https://commonwealth.im/img/brand_assets/common.png', + content: `https://${PRODUCTION_DOMAIN}/img/brand_assets/common.png`, }, } as const; diff --git a/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx b/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx index 95ef2a2b364..d48ca0e12ed 100644 --- a/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx +++ b/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx @@ -1,4 +1,4 @@ -import { DEFAULT_NAME } from '@hicommonwealth/shared'; +import { DEFAULT_NAME, PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import 'components/Profile/Profile.scss'; import React, { useEffect, useState } from 'react'; import { Helmet } from 'react-helmet-async'; @@ -119,7 +119,7 @@ const Profile = ({ userId }: ProfileProps) => { diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx index 137ad273f9c..ab2740f8bce 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx @@ -14,6 +14,7 @@ import MobileSearchModal from 'views/modals/MobileSearchModal'; import useUserMenuItems from '../useUserMenuItems'; +import { DOCS_SUBDOMAIN } from '@hicommonwealth/shared'; import useUserStore from 'state/ui/user'; import { AuthModalType } from 'views/modals/AuthModal'; import './MobileHeader.scss'; @@ -55,7 +56,7 @@ const MobileHeader = ({ }, { label: 'Help documentation', - onClick: () => window.open('https://docs.commonwealth.im/commonwealth/'), + onClick: () => window.open(`https://${DOCS_SUBDOMAIN}/commonwealth/`), }, ] as PopoverMenuItem[]; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicBanner/CWGatedTopicBanner.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicBanner/CWGatedTopicBanner.tsx index 6a4452bd782..ce8691975ae 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicBanner/CWGatedTopicBanner.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicBanner/CWGatedTopicBanner.tsx @@ -1,3 +1,4 @@ +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { useBrowserAnalyticsTrack } from 'hooks/useBrowserAnalyticsTrack'; import { useCommonNavigate } from 'navigation/helpers'; import React from 'react'; @@ -54,7 +55,7 @@ const CWGatedTopicBanner = ({ label: 'Learn more about gating', onClick: () => window.open( - `https://blog.commonwealth.im/introducing-common-groups/`, + `https://blog.${PRODUCTION_DOMAIN}/introducing-common-groups/`, ), }, ]} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicPermissionLevelBanner/CWGatedTopicPermissionLevelBanner.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicPermissionLevelBanner/CWGatedTopicPermissionLevelBanner.tsx index 15c4e6f2031..4ba9c727b07 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicPermissionLevelBanner/CWGatedTopicPermissionLevelBanner.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWGatedTopicPermissionLevelBanner/CWGatedTopicPermissionLevelBanner.tsx @@ -1,4 +1,5 @@ import { PermissionEnum } from '@hicommonwealth/schemas'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { useBrowserAnalyticsTrack } from 'hooks/useBrowserAnalyticsTrack'; import { useCommonNavigate } from 'navigation/helpers'; import React from 'react'; @@ -49,7 +50,7 @@ const CWGatedTopicPermissionLevelBanner = ({ label: 'Learn more about gating', onClick: () => window.open( - `https://blog.commonwealth.im/introducing-common-groups/`, + `https://blog.${PRODUCTION_DOMAIN}/introducing-common-groups/`, ), }, ]} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.tsx index 35c7f182e7a..bf8730df563 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.tsx @@ -27,7 +27,7 @@ actual data to be displayed (rowData). These are to be passed in a data structur emp_count: 1000, avatars: { name: { - avatarUrl: 'https://assets.commonwealth.im/f5c5a0c6-0552-40be-bb4b-b25fbd0cfbe2.png', + avatarUrl: `https://${S3_ASSET_BUCKET_CDN}/f5c5a0c6-0552-40be-bb4b-b25fbd0cfbe2.png`, address: null, }, }, @@ -291,11 +291,11 @@ export const CWTable = ({ {header.column.getCanSort() - ? displaySortIcon( + ? (displaySortIcon( header.column.getIsSorted() as string, // @ts-expect-error header.column.getToggleSortingHandler(), - ) ?? null + ) ?? null) : null} )} diff --git a/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx b/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx index 2b9d7bfd4d1..4226ed7b5ba 100644 --- a/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx @@ -8,6 +8,7 @@ import React, { import 'components/react_quill/markdown_formatted_text.scss'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import DOMPurify from 'dompurify'; import { loadScript } from 'helpers'; import { twitterLinkRegex } from 'helpers/constants'; @@ -29,7 +30,7 @@ const markdownRenderer = new marked.Renderer(); markdownRenderer.link = (href, title, text) => { return `${text}`; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx index 92eca6391fe..fad57b53e7a 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx @@ -1,4 +1,5 @@ import { TokenView } from '@hicommonwealth/schemas'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import 'components/sidebar/CommunitySection/CommunitySection.scss'; import { findDenominationString } from 'helpers/findDenomination'; import { useFlag } from 'hooks/useFlag'; @@ -146,7 +147,7 @@ export const CommunitySection = ({ showSkeleton }: CommunitySectionProps) => {
{ - window.open('https://commonwealth.im/'); + window.open(`https://${PRODUCTION_DOMAIN}/`); }} /> )} diff --git a/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.tsx b/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.tsx index 43a05517773..a36e88b0080 100644 --- a/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.tsx +++ b/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.tsx @@ -1,4 +1,8 @@ -import { ChainBase, ChainNetwork } from '@hicommonwealth/shared'; +import { + ChainBase, + ChainNetwork, + PRODUCTION_DOMAIN, +} from '@hicommonwealth/shared'; import { useFlag } from 'hooks/useFlag'; import { uuidv4 } from 'lib/util'; import { useCommonNavigate } from 'navigation/helpers'; @@ -134,7 +138,7 @@ const getCreateContentMenuItems = ( `${ !isCustomDomain ? window.location.origin - : 'https://commonwealth.im' + : `https://${PRODUCTION_DOMAIN}` }`, )}/discord-callback&response_type=code&scope=bot&state=${encodeURI( JSON.stringify({ diff --git a/packages/commonwealth/client/scripts/views/menus/help_menu.tsx b/packages/commonwealth/client/scripts/views/menus/help_menu.tsx index 12bf01ba4c2..aac124521d3 100644 --- a/packages/commonwealth/client/scripts/views/menus/help_menu.tsx +++ b/packages/commonwealth/client/scripts/views/menus/help_menu.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import { DOCS_SUBDOMAIN } from '@hicommonwealth/shared'; import { PopoverMenu } from 'views/components/component_kit/CWPopoverMenu'; import { CWTooltip } from 'views/components/component_kit/new_designs/CWTooltip'; import { @@ -17,7 +18,7 @@ export const HelpMenuPopover = () => { { label: 'Help documentation', onClick: () => - window.open('https://docs.commonwealth.im/commonwealth/'), + window.open(`https://${DOCS_SUBDOMAIN}/commonwealth/`), }, ]} renderTrigger={(onClick, isMenuOpen) => ( diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/UpdateCommunityIdTask.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/UpdateCommunityIdTask.tsx index bb054d8d422..ee460a2e53a 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/UpdateCommunityIdTask.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/UpdateCommunityIdTask.tsx @@ -1,3 +1,4 @@ +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; import React, { useState } from 'react'; import { slugifyPreserveDashes } from 'shared/utils'; @@ -76,8 +77,8 @@ const UpdateCommunityIdTask = () => {
Update Community Id - Updates a communities url e.g. commonwealth.im/cmn-protocol to - commonwealth.im/common. This does not update the Community name. + Updates a communities url e.g. ${PRODUCTION_DOMAIN}/cmn-protocol to $ + {PRODUCTION_DOMAIN}/common. This does not update the Community name. WARNING: This will set up a redirect from the old community to the new community. The old id cannot be used by any other community. diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.tsx index 1025bbdf942..98445e64b9c 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.tsx @@ -25,6 +25,7 @@ import { MessageRow } from 'views/components/component_kit/new_designs/CWTextInp import { openConfirmation } from 'views/modals/confirmation_modal'; import CommunityManagementLayout from 'views/pages/CommunityManagement/common/CommunityManagementLayout'; +import { BLOG_SUBDOMAIN } from '@hicommonwealth/shared'; import { CONTEST_FAQ_URL } from '../../../utils'; import { ContestFeeType, @@ -236,7 +237,7 @@ const DetailsFormStep = ({ <> Your contest is live and the smart contract settings cannot be - changed. Learn more + changed. Learn more ) : ( diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.tsx index 6c2c5800712..0b82ad1a170 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.tsx @@ -1,3 +1,4 @@ +import { DOCS_SUBDOMAIN, PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { buildUpdateCommunityInput } from 'client/scripts/state/api/communities/updateCommunity'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; import { uuidv4 } from 'lib/util'; @@ -95,7 +96,7 @@ const Discord = () => { const redirectURL = encodeURI( !domain?.isCustomDomain ? window.location.origin - : 'https://commonwealth.im', + : `https://${PRODUCTION_DOMAIN}`, ); const currentState = encodeURI( JSON.stringify({ @@ -188,7 +189,9 @@ const Discord = () => {

You can merge content from Discord directly into your community by connecting the Commonbot.{' '} - + Learn more

diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.tsx index 5f20c6fe8ca..05ee3371fe8 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.tsx @@ -1,5 +1,5 @@ import { Webhook, WebhookSupportedEvents } from '@hicommonwealth/schemas'; -import { getWebhookDestination } from '@hicommonwealth/shared'; +import { DOCS_SUBDOMAIN, getWebhookDestination } from '@hicommonwealth/shared'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; import { pluralizeWithoutNumberPrefix } from 'helpers'; import { linkValidationSchema } from 'helpers/formValidations/common'; @@ -158,7 +158,9 @@ const Webhooks = () => {

Slack, Discord, and Telegram webhooks are supported. For more information and examples for setting these up, please view our{' '} - + documentation . diff --git a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Avatars.showcase.tsx b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Avatars.showcase.tsx index 58512c25ecc..41b9165b87c 100644 --- a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Avatars.showcase.tsx +++ b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Avatars.showcase.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import { S3_ASSET_BUCKET_CDN } from '@hicommonwealth/shared'; import ghostImg from 'assets/img/ghost.svg'; import { CWAvatar } from 'views/components/component_kit/cw_avatar'; import { @@ -105,8 +106,7 @@ const avatarGroupProfiles = [ const communityAvatar = { name: 'dYdX', - iconUrl: - 'https://assets.commonwealth.im/5d4b9152-f45f-4864-83e5-074e0e892688.1627998072164', + iconUrl: `https://${S3_ASSET_BUCKET_CDN}/5d4b9152-f45f-4864-83e5-074e0e892688.1627998072164`, }; const AvatarsShowcase = () => { return ( diff --git a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Tables.showcase.tsx b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Tables.showcase.tsx index 6b3124b99b8..91f10f132e5 100644 --- a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Tables.showcase.tsx +++ b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Tables.showcase.tsx @@ -1,3 +1,4 @@ +import { S3_ASSET_BUCKET_CDN } from '@hicommonwealth/shared'; import { APIOrderDirection } from 'helpers/constants'; import React from 'react'; import { CWButton } from 'views/components/component_kit/new_designs/CWButton'; @@ -49,8 +50,7 @@ const newCommunity = (): any => { ), avatars: { name: { - avatarUrl: - 'https://assets.commonwealth.im/f5c5a0c6-0552-40be-bb4b-b25fbd0cfbe2.png', + avatarUrl: `https://${S3_ASSET_BUCKET_CDN}/f5c5a0c6-0552-40be-bb4b-b25fbd0cfbe2.png`, }, }, }; diff --git a/packages/commonwealth/client/scripts/views/pages/Contests/Contests.tsx b/packages/commonwealth/client/scripts/views/pages/Contests/Contests.tsx index 040115045ed..47e63574de4 100644 --- a/packages/commonwealth/client/scripts/views/pages/Contests/Contests.tsx +++ b/packages/commonwealth/client/scripts/views/pages/Contests/Contests.tsx @@ -7,6 +7,7 @@ import CWPageLayout from 'views/components/component_kit/new_designs/CWPageLayou import ContestsList from 'views/pages/CommunityManagement/Contests/ContestsList'; import useCommunityContests from 'views/pages/CommunityManagement/Contests/useCommunityContests'; +import { BLOG_SUBDOMAIN } from '@hicommonwealth/shared'; import { CWDivider } from '../../components/component_kit/cw_divider'; import './Contests.scss'; @@ -25,7 +26,7 @@ const Contests = () => { Check out the contests in this community. Winners are determined by having the most upvoted content in the contest topics.{' '} - Learn more + Learn more diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.tsx b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.tsx index f7ed191b62e..4785fc07604 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.tsx @@ -11,6 +11,7 @@ import { EnableStakeProps, StakeData } from '../types'; import useNamespaceFactory from '../useNamespaceFactory'; import { validationSchema } from './validations'; +import { DOCS_SUBDOMAIN } from '@hicommonwealth/shared'; import './EnableStake.scss'; const EnableStake = ({ @@ -117,7 +118,7 @@ const EnableStake = ({ Learn more about community stake diff --git a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.tsx b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.tsx index 592e3b8a291..25ef4d611de 100644 --- a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.tsx +++ b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.tsx @@ -1,3 +1,4 @@ +import { BLOG_SUBDOMAIN } from '@hicommonwealth/shared'; import noTransactionHistory from 'assets/img/noTransactionHistory.svg'; import { useCommonNavigate } from 'navigation/helpers'; import React from 'react'; @@ -7,7 +8,6 @@ import './NoTransactionHistory.scss'; const NoTransactionHistory = () => { const navigate = useCommonNavigate(); - return (

@@ -20,7 +20,9 @@ const NoTransactionHistory = () => { Purchasing community stake gives you more upvote power within your communities.{' '} - + Learn more diff --git a/packages/commonwealth/client/scripts/views/pages/old_terms.tsx b/packages/commonwealth/client/scripts/views/pages/old_terms.tsx index 22a89a7782c..80632129fd6 100644 --- a/packages/commonwealth/client/scripts/views/pages/old_terms.tsx +++ b/packages/commonwealth/client/scripts/views/pages/old_terms.tsx @@ -5,8 +5,9 @@ import { renderMultilineText } from 'helpers'; import 'pages/privacy_and_terms.scss'; -import { CWText } from '../components/component_kit/cw_text'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import Sublayout from '../Sublayout'; +import { CWText } from '../components/component_kit/cw_text'; const TermsOfService = ` PLEASE READ THE BELOW GOVERNANCE PLATFORM SERVICES AGREEMENT VERY CAREFULLY. THE BELOW GOVERNANCE PLATFORM SERVICES AGREEMENT IS A LEGALLY BINDING CONTRACT BETWEEN YOU AND COMMONWEALTH LABS THAT SETS FORTH AND DETERMINES, AMONG OTHER THINGS: @@ -21,7 +22,7 @@ BY DISCUSSING ISSUES, VOTING ON ISSUES, OR USING THE GOVERNANCE INTERFACE TO DEL IF YOU DO NOT AGREE TO ALL OF THE TERMS AND CONDITIONS OF THE GOVERNANCE PLATFORM SERVICES AGREEMENT, OR IF ANY OF THE REPRESENTATIONS AND WARRANTIES SET FORTH THE GOVERNANCE PLATFORM SERVICES AGREEMENT IS INACCURATE AS APPLIED TO YOU, YOU MUST NOT USE THE COMMONWEALTH GOVERNANCE PLATFORM. -Please contact us at hello@commonwealth.im for any questions or issues. +Please contact us at hello@${PRODUCTION_DOMAIN} for any questions or issues. GOVERNANCE PLATFORM SERVICES AGREEMENT diff --git a/packages/commonwealth/client/scripts/views/pages/privacy.tsx b/packages/commonwealth/client/scripts/views/pages/privacy.tsx index e017380e9a9..534db320d51 100644 --- a/packages/commonwealth/client/scripts/views/pages/privacy.tsx +++ b/packages/commonwealth/client/scripts/views/pages/privacy.tsx @@ -1,4 +1,5 @@ /* eslint-disable max-len */ +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import 'pages/privacy_and_terms.scss'; import React from 'react'; import { CWText } from '../components/component_kit/cw_text'; @@ -23,11 +24,11 @@ const PrivacyPage = () => {

Please read this Privacy Policy, which is part of our{' '} - Terms of Service, before - using our Service. If you do not agree with the Terms of Service - and/or this Privacy Policy, you must refrain from using our Service. - By accessing or using our Service you agree to our use of your - information consistent with the Terms of Service and this Privacy + Terms of Service, + before using our Service. If you do not agree with the Terms of + Service and/or this Privacy Policy, you must refrain from using our + Service. By accessing or using our Service you agree to our use of + your information consistent with the Terms of Service and this Privacy Policy, subject to your rights described below.

diff --git a/packages/commonwealth/main.ts b/packages/commonwealth/main.ts index 97fed177d49..fa7eae8f879 100644 --- a/packages/commonwealth/main.ts +++ b/packages/commonwealth/main.ts @@ -1,6 +1,7 @@ import { CacheDecorator, setupErrorHandlers } from '@hicommonwealth/adapters'; import { logger } from '@hicommonwealth/core'; import type { DB } from '@hicommonwealth/model'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import sgMail from '@sendgrid/mail'; import compression from 'compression'; import SessionSequelizeStore from 'connect-session-sequelize'; @@ -82,10 +83,10 @@ export async function main( }); const setupMiddleware = () => { - // redirect from commonwealthapp.herokuapp.com to commonwealth.im + // redirect from commonwealthapp.herokuapp.com to PRODUCTION_DOMAIN app.all(/.*/, (req, res, next) => { if (req.header('host')?.match(/commonwealthapp.herokuapp.com/i)) { - res.redirect(301, `https://commonwealth.im${req.url}`); + res.redirect(301, `https://${PRODUCTION_DOMAIN}{req.url}`); } else { next(); } diff --git a/packages/commonwealth/server/farcaster/frames/contest/contestCard.tsx b/packages/commonwealth/server/farcaster/frames/contest/contestCard.tsx index 2f8da787ef2..0597f76d6dd 100644 --- a/packages/commonwealth/server/farcaster/frames/contest/contestCard.tsx +++ b/packages/commonwealth/server/farcaster/frames/contest/contestCard.tsx @@ -3,6 +3,7 @@ import { Contest, config as modelConfig } from '@hicommonwealth/model'; import { Button } from 'frames.js/express'; import React from 'react'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { frames } from '../../config'; export const contestCard = frames(async (ctx) => { @@ -117,7 +118,7 @@ const getBaseUrl = () => { case 'demo': return 'https://demo.commonwealth.im'; default: - return 'https://commonwealth.im'; + return `https://${PRODUCTION_DOMAIN}`; } }; diff --git a/packages/commonwealth/server/routes/updateEmail.ts b/packages/commonwealth/server/routes/updateEmail.ts index 1977b8cf221..f1cbb159e61 100644 --- a/packages/commonwealth/server/routes/updateEmail.ts +++ b/packages/commonwealth/server/routes/updateEmail.ts @@ -1,6 +1,6 @@ import { AppError, logger } from '@hicommonwealth/core'; import { type DB } from '@hicommonwealth/model'; -import { DynamicTemplate } from '@hicommonwealth/shared'; +import { DynamicTemplate, PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import sgMail from '@sendgrid/mail'; import type { NextFunction, Request, Response } from 'express'; import Sequelize from 'sequelize'; @@ -63,7 +63,7 @@ const updateEmail = async ( }&email=${encodeURIComponent(email)}`; const msg = { to: email, - from: 'Commonwealth ', + from: `Commonwealth `, subject: 'Verify your Commonwealth email', templateId: DynamicTemplate.UpdateEmail, dynamic_template_data: { diff --git a/packages/commonwealth/server/routes/verifyAddress.ts b/packages/commonwealth/server/routes/verifyAddress.ts index dd532009839..18c90f377b9 100644 --- a/packages/commonwealth/server/routes/verifyAddress.ts +++ b/packages/commonwealth/server/routes/verifyAddress.ts @@ -6,6 +6,7 @@ import type { CommunityInstance, DB } from '@hicommonwealth/model'; import { ChainBase, DynamicTemplate, + PRODUCTION_DOMAIN, WalletId, addressSwapper, deserializeCanvas, @@ -134,7 +135,7 @@ const processAddress = async ( } const msg = { to: user.email, - from: 'Commonwealth ', + from: `Commonwealth `, templateId: DynamicTemplate.VerifyAddress, dynamic_template_data: { address, diff --git a/packages/commonwealth/server/scripts/generate-external-api-oas.ts b/packages/commonwealth/server/scripts/generate-external-api-oas.ts index 071065bb7fc..fafd85ec770 100644 --- a/packages/commonwealth/server/scripts/generate-external-api-oas.ts +++ b/packages/commonwealth/server/scripts/generate-external-api-oas.ts @@ -1,5 +1,6 @@ import { trpc } from '@hicommonwealth/adapters'; import { dispose, logger } from '@hicommonwealth/core'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { promises as fs } from 'fs'; import { isAbsolute } from 'path'; import { oasOptions, trpcRouter } from '../api/external-router'; @@ -23,7 +24,7 @@ async function main() { const host = process.argv[2] === 'production' - ? 'https://commonwealth.im' + ? `https://${PRODUCTION_DOMAIN}` : 'http://localhost:8080'; const oas = trpc.toOpenApiDocument(trpcRouter, host, oasOptions); diff --git a/packages/commonwealth/server/scripts/validate-external-api-versioning.ts b/packages/commonwealth/server/scripts/validate-external-api-versioning.ts index b7a6e81a176..71b3b267df4 100644 --- a/packages/commonwealth/server/scripts/validate-external-api-versioning.ts +++ b/packages/commonwealth/server/scripts/validate-external-api-versioning.ts @@ -1,5 +1,6 @@ import { trpc } from '@hicommonwealth/adapters'; import { dispose } from '@hicommonwealth/core'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { readFileSync } from 'fs'; import { readFile, unlink, writeFile } from 'fs/promises'; import pkg from 'openapi-diff'; @@ -91,13 +92,13 @@ async function validateExternalApiVersioning() { } await downloadFile( - 'https://commonwealth.im/api/v1/openapi.json', + `https://${PRODUCTION_DOMAIN}/api/v1/openapi.json`, productionOasPath, ); const newOas = trpc.toOpenApiDocument( trpcRouter, - 'http://commonwealth.im', // host must be the same as production + `https://${PRODUCTION_DOMAIN}`, // host must be the same as production oasOptions, ); await writeFile(localOasPath, JSON.stringify(newOas, null, 2), 'utf8'); diff --git a/packages/commonwealth/server/util/comsosProxy/handlers/cosmos.ts b/packages/commonwealth/server/util/comsosProxy/handlers/cosmos.ts index a3c4de3cb5b..19db86f89cf 100644 --- a/packages/commonwealth/server/util/comsosProxy/handlers/cosmos.ts +++ b/packages/commonwealth/server/util/comsosProxy/handlers/cosmos.ts @@ -1,6 +1,6 @@ import { logger } from '@hicommonwealth/core'; import { ChainNodeInstance, models } from '@hicommonwealth/model'; -import { NodeHealth } from '@hicommonwealth/shared'; +import { NodeHealth, PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import axios from 'axios'; import type { Request, Response } from 'express'; import _ from 'lodash'; @@ -75,7 +75,7 @@ export async function cosmosHandler( _.isEmpty(req.body) ? null : req.body, { headers: { - origin: 'https://commonwealth.im', + origin: `https://${PRODUCTION_DOMAIN}`, }, }, ); diff --git a/packages/commonwealth/server/util/comsosProxy/handlers/magic.ts b/packages/commonwealth/server/util/comsosProxy/handlers/magic.ts index 72be3d13c56..fe2100dc6fc 100644 --- a/packages/commonwealth/server/util/comsosProxy/handlers/magic.ts +++ b/packages/commonwealth/server/util/comsosProxy/handlers/magic.ts @@ -1,5 +1,6 @@ import { logger } from '@hicommonwealth/core'; import { models } from '@hicommonwealth/model'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import axios from 'axios'; import type { Request, Response } from 'express'; @@ -32,7 +33,7 @@ export async function cosmosMagicNodeInfoProxyHandler( const response = await axios.get(targetRestUrl + '/node_info', { headers: { - origin: 'https://commonwealth.im/?magic_login_proxy=true', + origin: `https://${PRODUCTION_DOMAIN}/?magic_login_proxy=true`, }, }); diff --git a/packages/commonwealth/server/util/comsosProxy/utils.ts b/packages/commonwealth/server/util/comsosProxy/utils.ts index 0c0d3ca4aec..2c2d0a3a54e 100644 --- a/packages/commonwealth/server/util/comsosProxy/utils.ts +++ b/packages/commonwealth/server/util/comsosProxy/utils.ts @@ -1,6 +1,10 @@ import { logger } from '@hicommonwealth/core'; import { ChainNodeInstance, models } from '@hicommonwealth/model'; -import { CosmosGovernanceVersion, NodeHealth } from '@hicommonwealth/shared'; +import { + CosmosGovernanceVersion, + NodeHealth, + PRODUCTION_DOMAIN, +} from '@hicommonwealth/shared'; import axios, { AxiosResponse } from 'axios'; import { Request } from 'express'; import _ from 'lodash'; @@ -78,9 +82,9 @@ export async function updateSlip44IfNeeded( `https://chains.cosmos.directory/${chainNode.cosmos_chain_id}`, { headers: { - origin: 'https://commonwealth.im', + origin: `https://${PRODUCTION_DOMAIN}`, Referer: - process.env.COSMOS_PROXY_REFERER || 'https://commonwealth.im', + process.env.COSMOS_PROXY_REFERER || `https://${PRODUCTION_DOMAIN}`, }, }, ); @@ -167,8 +171,9 @@ export async function queryExternalProxy( log.info(`Querying Cosmos node at ${url}`); return await axios.post(url, _.isEmpty(req.body) ? null : req.body, { headers: { - origin: 'https://commonwealth.im', - Referer: process.env.COSMOS_PROXY_REFERER || 'https://commonwealth.im', + origin: `https://${PRODUCTION_DOMAIN}`, + Referer: + process.env.COSMOS_PROXY_REFERER || `https://${PRODUCTION_DOMAIN}`, }, }); } diff --git a/packages/commonwealth/server/util/ipfsProxy.ts b/packages/commonwealth/server/util/ipfsProxy.ts index 6d9951eb0e6..4d7ad7b1564 100644 --- a/packages/commonwealth/server/util/ipfsProxy.ts +++ b/packages/commonwealth/server/util/ipfsProxy.ts @@ -2,6 +2,7 @@ import { CacheDecorator, lookupKeyDurationInReq, } from '@hicommonwealth/adapters'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import axios from 'axios'; import type { Router } from 'express'; import { registerRoute } from '../middleware/methodNotAllowed'; @@ -26,7 +27,7 @@ function setupIpfsProxy(router: Router, cacheDecorator: CacheDecorator) { `https://cloudflare-ipfs.com/ipfs/${hash}#x-ipfs-companion-no-redirect`, { headers: { - origin: 'https://commonwealth.im', + origin: `https://${PRODUCTION_DOMAIN}`, }, timeout: 5000, responseType: isImageRequest ? 'arraybuffer' : 'json', diff --git a/packages/commonwealth/shared/utils.ts b/packages/commonwealth/shared/utils.ts index 793d51e7eda..987bac1ae26 100644 --- a/packages/commonwealth/shared/utils.ts +++ b/packages/commonwealth/shared/utils.ts @@ -1,3 +1,4 @@ +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import { Dec, IntPretty } from '@keplr-wallet/unit'; import { isHex, isU8a } from '@polkadot/util'; import { @@ -25,7 +26,7 @@ export const slugifyPreserveDashes = (str: string): string => { // WARN: Using process.env to avoid webpack failures export const getCommunityUrl = (community: string): string => { return process.env.NODE_ENV === 'production' - ? `https://commonwealth.im/${community}` + ? `https://${PRODUCTION_DOMAIN}/${community}` : `http://localhost:8080/${community}`; }; diff --git a/packages/commonwealth/test/integration/api/user.spec.ts b/packages/commonwealth/test/integration/api/user.spec.ts index 009357608d4..f497e9ca274 100644 --- a/packages/commonwealth/test/integration/api/user.spec.ts +++ b/packages/commonwealth/test/integration/api/user.spec.ts @@ -2,6 +2,7 @@ /* eslint-disable no-unused-expressions */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { dispose } from '@hicommonwealth/core'; +import { PRODUCTION_DOMAIN } from '@hicommonwealth/shared'; import chai from 'chai'; import chaiHttp from 'chai-http'; import jwt from 'jsonwebtoken'; @@ -52,7 +53,7 @@ describe('User Model Routes', () => { }); test('should add an email to user with just an address', async () => { - const email = 'test@commonwealth.im'; + const email = `test@${PRODUCTION_DOMAIN}`; const res = await chai .request(server.app) .post('/api/updateEmail') @@ -84,7 +85,7 @@ describe('User Model Routes', () => { .set('Accept', 'application/json') .send({ jwt: jwtToken, - email: 'test@commonwealth.im', + email: `test@${PRODUCTION_DOMAIN}`, }); expect(res.body.error).to.not.be.null; expect(res.body.error).to.be.equal(updateEmailErrors.EmailInUse);