mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 07:14:02 +00:00
fix incorrect subdomain identification
This commit is contained in:
parent
45cf7029af
commit
59d2c6d98d
1 changed files with 12 additions and 2 deletions
|
|
@ -56,9 +56,19 @@ class DomainTenantResolver extends Contracts\CachedTenantResolver
|
||||||
return $tenant;
|
return $tenant;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isSubdomain(string $domain): bool
|
protected function isSubdomain(string $hostname): bool
|
||||||
{
|
{
|
||||||
return Str::endsWith($domain, config('tenancy.identification.central_domains'));
|
foreach (config('tenancy.central_domains') as $domain) {
|
||||||
|
if ($hostname === $domain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Str::endsWith($hostname, '.' . $domain)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resolved(Tenant $tenant, mixed ...$args): void
|
public function resolved(Tenant $tenant, mixed ...$args): void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue