Commit d8a66b7d authored by Grant's avatar Grant
Browse files

trust proxy

parent 12d1347a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
import { setupAllProviders } from "./lib/delivery/index.js";
import { app as Express } from "./lib/express.js";
import { oidc } from "./lib/oidc.js";

if (typeof process.env.SESSION_SECRET !== "string") {
  throw new Error("SESSION_SECRET is not defined");
@@ -32,6 +33,11 @@ if (process.env.NODE_ENV === "production") {
  if (typeof process.env.OIDC_COOKIE_KEYS_FILE !== "string") {
    throw new Error("OIDC_COOKIE_KEYS_FILE is not defined");
  }

  if (!process.env.USE_INSECURE) {
    oidc.proxy = true;
    Express.enable("trust proxy");
  }
}

setupAllProviders().then((providers) => {