We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27a165b commit c91ea28Copy full SHA for c91ea28
packages/auth-server-api/src/app.ts
@@ -14,8 +14,9 @@ app.use(express.json());
14
15
// CORS configuration
16
const allowlist = env.CORS_ORIGINS.split(",").map((origin) => origin.trim());
17
+const isAllowAll = allowlist.includes("*");
18
const corsOrigins = (origin: string | undefined, callback: (err: Error | null, allow?: boolean) => void) => {
- if (!origin || allowlist.indexOf(origin) !== -1) {
19
+ if (!origin || isAllowAll || allowlist.indexOf(origin) !== -1) {
20
callback(null, true);
21
} else {
22
callback(new Error("Not allowed by CORS"));
0 commit comments