Skip to content

Commit 39658a0

Browse files
authored
Merge branch 'AmanVarshney01:main' into main
2 parents 1f8afc7 + 8d48ae0 commit 39658a0

File tree

1 file changed

+10
-0
lines changed
  • apps/cli/templates/api/orpc/web/react/base/src/utils

1 file changed

+10
-0
lines changed

apps/cli/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ export const link = new RPCLink({
3333
credentials: "include",
3434
});
3535
},
36+
{{#if (includes frontend "next")}}
37+
headers: async () => {
38+
if (typeof window !== "undefined") {
39+
return {}
40+
}
41+
42+
const { headers } = await import("next/headers")
43+
return Object.fromEntries(await headers())
44+
},
45+
{{/if}}
3646
{{/if}}
3747
});
3848

0 commit comments

Comments
 (0)