Skip to content

Commit 0fddfd0

Browse files
committed
pr changes
1 parent 3406272 commit 0fddfd0

5 files changed

Lines changed: 12 additions & 99 deletions

File tree

apps/backend/src/lib/ai/forward.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ export async function forwardToProduction(
66
body: RequestBody,
77
): Promise<Response> {
88
const productionUrl = `https://api.stack-auth.com/api/latest/ai/query/${mode}`;
9+
const allowedHeaders = new Set([
10+
"x-stack-access-token",
11+
"x-stack-publishable-client-key",
12+
]);
13+
914
const forwardHeaders = new Headers();
1015
for (const [key, values] of Object.entries(requestHeaders)) {
1116
if (values == null) continue;
1217
const lowerKey = key.toLowerCase();
13-
if (!lowerKey.startsWith("x-stack-")) continue;
18+
if (!allowedHeaders.has(lowerKey)) continue;
1419
forwardHeaders.set(lowerKey, values[0] ?? "");
1520
}
1621

apps/dashboard/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ next-env.d.ts
3838
# local dev IIFE bundles (built locally, not committed)
3939
/public/dashboard-ui-components.iife.js
4040
/public/dashboard-ui-components.iife.js.map
41+
42+
# auto-generated files (rebuilt at build time and in dev watch)
43+
/src/generated/bundled-type-definitions.ts

apps/dashboard/scripts/bundle-type-definitions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ async function main() {
8686
// Strip imports, exports, sourcemap comments
8787
raw = raw
8888
.replace(/^import\s+\*\s+as\s+.*$/gm, '')
89+
.replace(/^import\s+\{[^}]*\}\s+from\s+["'][^"']*["']\s*;?\s*$/gm, '')
8990
.replace(/^export\s*\{[^}]*\}\s*;?\s*$/gm, '')
9091
.replace(/^\/\/#\s*sourceMappingURL=.*$/gm, '');
9192

apps/dashboard/src/generated/bundled-type-definitions.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

packages/stack-shared/src/config/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,10 +725,10 @@ const organizationConfigDefaults = {
725725
}),
726726
},
727727

728-
customDashboards: typedAssign((key: string) => ({
728+
customDashboards: (key: string) => ({
729729
displayName: "Unnamed Dashboard",
730730
tsxSource: "Error: Dashboard config is missing source code.",
731-
}), {}),
731+
}),
732732
} as const satisfies DefaultsType<OrganizationRenderedConfigBeforeDefaults, [typeof environmentConfigDefaults, typeof branchConfigDefaults, typeof projectConfigDefaults]>;
733733

734734
type _DeepOmitDefaultsImpl<T, U> = T extends object ? (

0 commit comments

Comments
 (0)