mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 21:32:10 +03:00
fix(authz): Restore REQUIRE_API_KEY support in clientApi policy
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user