Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres

This commit is contained in:
Juan Pablo Vial
2025-06-06 17:11:33 -04:00
23 changed files with 254 additions and 101 deletions

View File

@ -45,7 +45,9 @@ class Login
$body = $response->getBody()->getContents();
$data = json_decode($body, true);
if (!key_exists('token', $data)) {
$this->logger->error('Token not found');
$this->logger->error('Token not found', [
'body' => $body
]);
return '';
}
$result = file_put_contents($this->tokenFilename, $data['token']);
@ -93,7 +95,7 @@ class Login
} catch (Exception $exception) {
$this->logger->notice($exception);
$savedToken = $this->login();
if ($savedToken === '') {
if ($savedToken === '' and file_exists($this->tokenFilename)) {
unlink($this->tokenFilename);
return '';
}