fix: 🐛 demo rerouting x-client-env to reuse cookie

This commit is contained in:
amianthus
2025-10-08 18:46:34 +01:00
parent 9280133f6b
commit f68a05cec0
2 changed files with 6 additions and 1 deletions

View File

@@ -57,7 +57,10 @@ export const betterAuthMiddleware = async (c: Context<HonoEnv>, next: Next) => {
}
// Step 4: Fetch org and features from database
ctx.env = c.req.header("app_env") as AppEnv;
const appEnvHeader = c.req.header("app_env") as AppEnv;
if (appEnvHeader) {
ctx.env = appEnvHeader;
}
const data = await OrgService.getWithFeatures({
db: ctx.db,
orgId: orgId,

View File

@@ -115,6 +115,8 @@ mainRouter.use(
cookie: req.headers.cookie,
"Content-Type": "application/json",
origin: req.get("origin"),
"x-client-type": "dashboard",
app_env: req.env || req.headers.app_env,
},
});
return client as any;