feat/improve-authentication #28

Merged
Sebastian merged 2 commits from feat/improve-authentication into main 2026-02-20 05:04:16 +00:00
2 changed files with 25 additions and 0 deletions
Showing only changes of commit decda8becc - Show all commits

View File

@@ -16,4 +16,9 @@ class TenantService
return $this->store->fetchByDomain($domain);
}
public function fetchById(string $identifier): ?TenantObject
{
return $this->store->fetch($identifier);
}
}

View File

@@ -37,6 +37,26 @@ class SessionTenant
}
}
/**
* Configure the tenant by its identifier (for console / CLI usage).
*/
public function configureById(string $identifier): void
{
if ($this->configured) {
return;
}
$tenant = $this->tenantService->fetchById($identifier);
if ($tenant) {
$this->domain = $identifier;
$this->tenant = $tenant;
$this->configured = true;
} else {
$this->domain = null;
$this->tenant = null;
$this->configured = false;
}
}
/**
* Is the tenant configured
*/