Create wildcard domains

This commit is contained in:
Owen 2025-07-14 12:18:12 -07:00
parent b75800c583
commit 69d253fba3
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
6 changed files with 214 additions and 157 deletions

View file

@ -43,6 +43,7 @@ import { createNewt, getNewtToken } from "./newt";
import { getOlmToken } from "./olm";
import rateLimit from "express-rate-limit";
import createHttpError from "http-errors";
import { build } from "@server/build";
// Root routes
export const unauthenticated = Router();
@ -57,7 +58,9 @@ authenticated.use(verifySessionUserMiddleware);
authenticated.get("/pick-org-defaults", org.pickOrgDefaults);
authenticated.get("/org/checkId", org.checkId);
authenticated.put("/org", getUserOrgs, org.createOrg);
if (build === "oss" || build === "enterprise") {
authenticated.put("/org", getUserOrgs, org.createOrg);
}
authenticated.get("/orgs", verifyUserIsServerAdmin, org.listOrgs);
authenticated.get("/user/:userId/orgs", verifyIsLoggedInUser, org.listUserOrgs);