refactor(arch): enforce gateway compliance and remove service-wrapping gateways
This commit is contained in:
@@ -7,6 +7,7 @@ use MintyPHP\Http\SessionStoreInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\Audit\SystemAuditService;
|
||||
use MintyPHP\Service\User\UserAccountService;
|
||||
use MintyPHP\Service\User\UserTenantContextService;
|
||||
@@ -22,8 +23,8 @@ class AuthService
|
||||
private readonly UserTenantContextService $userTenantContextService,
|
||||
private readonly RememberMeService $rememberMeService,
|
||||
private readonly EmailVerificationService $emailVerificationService,
|
||||
private readonly AuthPermissionGateway $permissionGateway,
|
||||
private readonly AuthTenantSsoGateway $tenantSsoGateway,
|
||||
private readonly PermissionService $permissionService,
|
||||
private readonly TenantSsoService $tenantSsoService,
|
||||
private readonly AuthSessionTenantContextService $authSessionTenantContextService,
|
||||
private readonly SystemAuditService $systemAuditService,
|
||||
private readonly SessionStoreInterface $sessionStore
|
||||
@@ -92,7 +93,7 @@ class AuthService
|
||||
];
|
||||
}
|
||||
if ($userId > 0) {
|
||||
$this->permissionGateway->warmUserPermissions($userId, true);
|
||||
$this->permissionService->getUserPermissions($userId, true);
|
||||
$this->loadTenantDataIntoSession($userId);
|
||||
if ($this->noActiveTenant()) {
|
||||
Auth::logout();
|
||||
@@ -135,7 +136,7 @@ class AuthService
|
||||
if ($tenantId <= 0) {
|
||||
continue;
|
||||
}
|
||||
if ($this->tenantSsoGateway->isLocalPasswordLoginAllowed($tenantId)) {
|
||||
if ($this->tenantSsoService->isLocalPasswordLoginAllowed($tenantId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -184,7 +185,7 @@ class AuthService
|
||||
}
|
||||
}
|
||||
|
||||
$this->permissionGateway->warmUserPermissions($userId, true);
|
||||
$this->permissionService->getUserPermissions($userId, true);
|
||||
$this->loadTenantDataIntoSession($userId);
|
||||
if ($this->noActiveTenant()) {
|
||||
Auth::logout();
|
||||
@@ -336,7 +337,7 @@ class AuthService
|
||||
}
|
||||
|
||||
$this->sessionStore->set('user', $user);
|
||||
$this->permissionGateway->warmUserPermissions($userId, true);
|
||||
$this->permissionService->getUserPermissions($userId, true);
|
||||
$this->loadTenantDataIntoSession($userId);
|
||||
$refreshed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user