cleanup serviceUrl, host, basepath configurable

This commit is contained in:
Max Peintner
2025-01-29 10:34:33 +01:00
parent e8900501b9
commit 04f9b47960
43 changed files with 426 additions and 597 deletions

View File

@@ -23,29 +23,24 @@ export default async function Page(props: {
searchParams;
const _headers = await headers();
const instanceUrl = getApiUrlOfHeaders(_headers);
const host = instanceUrl;
if (!host || typeof host !== "string") {
throw new Error("No host found");
}
const serviceUrl = getApiUrlOfHeaders(_headers);
if (!organization) {
const org: Organization | null = await getDefaultOrg({ host });
const org: Organization | null = await getDefaultOrg({ serviceUrl });
if (org) {
organization = org.id;
}
}
const legal = await getLegalAndSupportSettings({ host, organization });
const legal = await getLegalAndSupportSettings({ serviceUrl, organization });
const passwordComplexitySettings = await getPasswordComplexitySettings({
host,
serviceUrl,
organization,
});
const branding = await getBrandingSettings({ host, organization });
const branding = await getBrandingSettings({ serviceUrl, organization });
const loginSettings = await getLoginSettings({ host, organization });
const loginSettings = await getLoginSettings({ serviceUrl, organization });
if (!loginSettings?.allowRegister) {
return (