Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-react-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Expand Down
12 changes: 10 additions & 2 deletions sample-apps/react/react-dogfood/helpers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -58,3 +65,4 @@ export const createTokenProvider =
const json = await ((await res.json()) as Promise<CreateJwtTokenResponse>);
return json.token;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const createJwtToken = async (
req: NextApiRequest,
res: NextApiResponse<CreateJwtTokenResponse | CreateJwtTokenErrorResponse>,
) => {
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,
Expand Down