This commit is contained in:
2026-03-12 14:23:32 +01:00
parent d93f43bf01
commit 0084c5f05b
60 changed files with 7526 additions and 7522 deletions

View File

@@ -1,20 +1,20 @@
import { headers } from 'next/headers'
const RESERVED_SUBDOMAINS = ['www', 'app', 'admin', 'localhost', 'superadmin', 'api']
export async function getTenantSlug() {
const host = (await headers()).get('host') || ''
const domainParts = host.split(':')[0].split('.')
if (
domainParts.length > 2 ||
(domainParts.length === 2 && domainParts[1] === 'localhost')
) {
const slug = domainParts[0]
if (!RESERVED_SUBDOMAINS.includes(slug)) {
return slug
}
}
return null
}
import { headers } from 'next/headers'
const RESERVED_SUBDOMAINS = ['www', 'app', 'admin', 'localhost', 'superadmin', 'api']
export async function getTenantSlug() {
const host = (await headers()).get('host') || ''
const domainParts = host.split(':')[0].split('.')
if (
domainParts.length > 2 ||
(domainParts.length === 2 && domainParts[1] === 'localhost')
) {
const slug = domainParts[0]
if (!RESERVED_SUBDOMAINS.includes(slug)) {
return slug
}
}
return null
}