Skip to content

Commit

Permalink
Add vercel bypass secret to tRPC calls
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Sep 25, 2024
1 parent cd2b9c9 commit 146040a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions apps/nextjs/tests-e2e/helpers/auth.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import { TestSupportRouter } from "@oakai/api/src/router/testSupport";
import { transformer } from "@oakai/api/transformer";
import { test, Page } from "@playwright/test";
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import { createTRPCProxyClient, httpBatchLink, loggerLink } from "@trpc/client";

import { TEST_BASE_URL } from "../config/config";
import {
TEST_BASE_URL,
VERCEL_AUTOMATION_BYPASS_SECRET,
} from "../config/config";

const trpc = createTRPCProxyClient<TestSupportRouter>({
transformer,
links: [
loggerLink(),
httpBatchLink({
url: `${TEST_BASE_URL}/api/trpc/test-support`,
url: `${TEST_BASE_URL}/api/trpc/test-support/test`,
headers: {
"x-vercel-protection-bypass": VERCEL_AUTOMATION_BYPASS_SECRET,
},
}),
],
});
Expand Down

0 comments on commit 146040a

Please sign in to comment.