mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-10 17:35:57 +00:00
2b795265e7
* fix: align auth-disabled mode and mock history loading * fix: address auth-disabled review feedback * test: cover auth-disabled backend contract * style: format frontend tests * fix: address follow-up review comments
24 lines
575 B
TypeScript
24 lines
575 B
TypeScript
import type { User } from "./types";
|
|
|
|
export const AUTH_DISABLED_USER: User = {
|
|
id: "e2e-user",
|
|
email: "e2e@test.local",
|
|
system_role: "admin",
|
|
needs_setup: false,
|
|
};
|
|
|
|
const PRODUCTION_ENV_VALUES = new Set(["prod", "production"]);
|
|
|
|
function isExplicitProductionEnvironment() {
|
|
return ["DEER_FLOW_ENV", "ENVIRONMENT"].some((name) =>
|
|
PRODUCTION_ENV_VALUES.has((process.env[name] ?? "").trim().toLowerCase()),
|
|
);
|
|
}
|
|
|
|
export function isAuthDisabledMode() {
|
|
return (
|
|
process.env.DEER_FLOW_AUTH_DISABLED === "1" &&
|
|
!isExplicitProductionEnvironment()
|
|
);
|
|
}
|