diff --git a/.github/workflows/deploy-react-sample-apps.yml b/.github/workflows/deploy-react-sample-apps.yml index 890a2f949b..f280ba0523 100644 --- a/.github/workflows/deploy-react-sample-apps.yml +++ b/.github/workflows/deploy-react-sample-apps.yml @@ -91,7 +91,7 @@ jobs: ### Vercel deployment (Preview) ### - name: Vercel Pull/Build/Deploy (Preview) - if: ${{ github.ref_name != 'main' && matrix.application.manual-only != true }} + if: ${{ github.ref_name != 'main' }} env: NEXT_PUBLIC_BASE_PATH: ${{ matrix.application.base-path || '' }} run: > diff --git a/sample-apps/react/react-dogfood/helpers/client.ts b/sample-apps/react/react-dogfood/helpers/client.ts index 073cf99874..22284b4ee9 100644 --- a/sample-apps/react/react-dogfood/helpers/client.ts +++ b/sample-apps/react/react-dogfood/helpers/client.ts @@ -46,8 +46,15 @@ export const getClient = ( const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''; -export const createTokenProvider = - (userId: string | undefined, environment: AppEnvironment) => async () => { +export const createTokenProvider = ( + userId: string | undefined, + environment: AppEnvironment, +) => { + if (process.env.NEXT_PUBLIC_APP_ENVIRONMENT === 'pronto-sales') { + return undefined; + } + + return async () => { const params = new URLSearchParams({ user_id: userId || '!anon', environment, @@ -58,3 +65,4 @@ export const createTokenProvider = const json = await ((await res.json()) as Promise); return json.token; }; +}; diff --git a/sample-apps/react/react-dogfood/pages/api/auth/create-token.ts b/sample-apps/react/react-dogfood/pages/api/auth/create-token.ts index 255433475c..371e9b3046 100644 --- a/sample-apps/react/react-dogfood/pages/api/auth/create-token.ts +++ b/sample-apps/react/react-dogfood/pages/api/auth/create-token.ts @@ -38,6 +38,10 @@ const createJwtToken = async ( req: NextApiRequest, res: NextApiResponse, ) => { + if (process.env.NEXT_PUBLIC_APP_ENVIRONMENT === 'pronto-sales') { + return error(res, 'This endpoint is not enabled', 404); + } + const { user_id: userId, api_key: apiKeyFromRequest,