refactor: split buspro ApiClient into domain clients
This commit is contained in:
1 parent
0a55544ca8
commit
b755a6f43e
52 files changed
+805
-695
No files matched your search
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Security;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Client\AccountClient;
|
||||
use App\BusProNet\Exception\ApiClientException;
|
||||
use App\BusProNet\Exception\ImmediateConnectionCloseException;
|
||||
use App\BusProNet\Exception\TimeoutException;
|
||||
@@ -50,7 +50,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
|
||||
public function __construct(
|
||||
private readonly UrlGeneratorInterface $urlGenerator,
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly AccountClient $accountClient,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly Crypt $crypt,
|
||||
private readonly ProfileCompletenessChecker $completenessChecker,
|
||||
@@ -77,7 +77,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
$password = md5($passwordPlain);
|
||||
|
||||
try {
|
||||
$response = $this->apiClient->getPersonalData($email, $password);
|
||||
$response = $this->accountClient->getPersonalData($email, $password);
|
||||
} catch (ApiClientException $e) {
|
||||
$message = $this->isConnectionError($e) ?
|
||||
'Der Server ist momentan nicht erreichbar. Bitte versuche es später erneut.' : $e->getMessage();
|
||||
@@ -103,7 +103,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
private function createOrUpdateLocalUser(string $email, string $password, PersonalData $personalData): User
|
||||
{
|
||||
try {
|
||||
$crmAttributes = $this->apiClient->getCrmAttributes($email, $password);
|
||||
$crmAttributes = $this->accountClient->getCrmAttributes($email, $password);
|
||||
} catch (ApiClientException $e) {
|
||||
$message = $this->isConnectionError($e) ?
|
||||
'Der Server ist momentan nicht erreichbar. Bitte versuche es später erneut. :(' : $e->getMessage();
|
||||
|
||||
Reference in new issue
Block a user