fix super admin

This commit is contained in:
2026-09-10 10:04:55 +03:30
parent bcf4724ac4
commit a78636d32e
4 changed files with 214 additions and 11 deletions
+11
View File
@@ -56,6 +56,17 @@ describe('findTenantForHost', () => {
expect(scoreTenantHost(mine, api)).toBe(75);
});
it('full match uses extra IP aliases like get_user', () => {
const tenant = fromDomain('k.montzar.ir', {
domains: ['192.168.70.191', '192.168.70.184', '192.168.70.158'],
});
expect(findTenantForHost([tenant], '192.168.70.191')?.domain).toBe(
'k.montzar.ir',
);
expect(scoreTenantHost(tenant, '192.168.70.191')).toBe(90);
});
it('does not pick a tenant when only a shared nodeServer matches', () => {
const api = 'box.example.ir';
const left = fromDomain('a.ir', { nodeServer: `https://${api}/server` });