Skip to content

Commit

Permalink
workaround AUTH0_SECRET absent at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
tjanczuk committed Nov 16, 2023
1 parent 83d76a0 commit d8c6c4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/api/proxy/[...path]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import proxyFactory from "../../proxy";

// The withApiAuthRequired is evaluated at build time but expectes AUTH0_SECRET to be set.
const oldAuth0Secret = process.env.AUTH0_SECRET;
process.env.AUTH0_SECRET =
process.env.AUTH0_SECRET || "never-used-secret-value";
process.env["AUTH0_SECRET"] =
process.env["AUTH0_SECRET"] || "never-used-secret-value";
const proxy = withApiAuthRequired(
proxyFactory({ addAccessTokenToRequest: true })
);
process.env.AUTH0_SECRET = oldAuth0Secret;
process.env["AUTH0_SECRET"] = oldAuth0Secret;

export const GET = proxy;
export const POST = proxy;
Expand Down

0 comments on commit d8c6c4b

Please sign in to comment.