Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres
This commit is contained in:
@ -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 '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user