fix(authz): Restore REQUIRE_API_KEY support in clientApi policy

This commit is contained in:
diegosouzapw
2026-04-27 13:25:32 -03:00
parent ed9a7e5495
commit 8a8e6ca349
7 changed files with 75 additions and 37 deletions

View File

@@ -35,6 +35,11 @@ export const clientApiPolicy: RoutePolicy = {
) {
return allow({ kind: "dashboard_session", id: "dashboard" });
}
if (process.env.REQUIRE_API_KEY !== "true") {
return allow({ kind: "anonymous", id: "local" });
}
return reject(401, "AUTH_002", "Authentication required");
}