Refactor session initialization and host validation logic

This commit is contained in:
netkas 2024-12-24 19:18:06 -05:00
parent 738f8a455c
commit c380556255
5 changed files with 138 additions and 44 deletions

View file

@ -3,6 +3,7 @@
namespace Socialbox\Objects;
use InvalidArgumentException;
use Socialbox\Classes\Configuration;
use Socialbox\Classes\Validator;
use Socialbox\Enums\ReservedUsernames;
@ -67,7 +68,7 @@
*/
public function isHost(): bool
{
return $this->username === ReservedUsernames::HOST->value;
return $this->username === ReservedUsernames::HOST->value && $this->domain === Configuration::getInstanceConfiguration()->getDomain();
}
/**