rename auth and start work separating config

This commit is contained in:
Milo Schwartz 2025-01-01 16:40:01 -05:00
parent deac897037
commit d3bfac20a0
15 changed files with 153 additions and 120 deletions

View file

@ -3,10 +3,11 @@ import { orgs } from "../db/schema";
import config from "@server/config";
import { ne } from "drizzle-orm";
import logger from "@server/logger";
import { extractBaseDomain } from "@server/utils/extractBaseDomain";
export async function copyInConfig() {
// create a url from config.app.base_url and get the hostname
const domain = new URL(config.app.base_url).hostname;
const domain = extractBaseDomain(config.app.base_url);
// update the domain on all of the orgs where the domain is not equal to the new domain
// TODO: eventually each org could have a unique domain that we do not want to overwrite, so this will be unnecessary