This commit is contained in:
Jordan Diaz
2026-05-15 19:15:04 +00:00
parent f7c6e65c0b
commit c5c001468f

View File

@@ -37,6 +37,14 @@ export function getCurrentProjectInfo() {
export async function callLocalFileEndpoint(method, endpoint, payload = null, query = null) {
const headers = getLocalServerHeaders();
const authHeader = process.env.ACAI_AUTH_HEADER || "";
const mode = process.env.ACAI_MODE_OVERRIDE || process.env.ACAI_MODE || "";
const role = process.env.ACAI_ROLE_OVERRIDE || "";
if (authHeader) headers["Authorization"] = authHeader;
if (mode) headers["X-Acai-Mode"] = mode;
if (role) headers["X-Acai-Role"] = role;
// Inyectar X-Acai-User cuando hay sesion HTTP activa: permite que los
// endpoints autenticados del server Python identifiquen al usuario sin
// depender de Authorization Basic.