fix: 🐛 demo rerouting x-client-env to reuse cookie
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user