mirror of
https://github.com/open-reception/appointment-booking-software.git
synced 2026-08-17 21:25:52 +02:00
Fix: Custom domains don't have to match shortName
This commit is contained in:
@@ -20,14 +20,14 @@ export const getTenantIdByDomain = async (
|
||||
return tenants[0].id || null;
|
||||
} else {
|
||||
// Get tenant ID by domain in production
|
||||
const shortName = domain.replace("https://", "").split(".")[0];
|
||||
const cleanDomain = domain.replace("https://", "");
|
||||
try {
|
||||
const tenants = await db
|
||||
.select({
|
||||
id: tenant.id,
|
||||
})
|
||||
.from(tenant)
|
||||
.where(eq(tenant.shortName, shortName))
|
||||
.where(eq(tenant.domain, cleanDomain))
|
||||
.limit(1);
|
||||
return tenants[0]?.id || null;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user