FIX: Mas registro de login desde cli
This commit is contained in:
@ -29,6 +29,12 @@ class Login
|
||||
}
|
||||
|
||||
if ($response->getStatusCode() !== 200) {
|
||||
$this->logger->error('Login failed', [
|
||||
'statusCode' => $response->getStatusCode(),
|
||||
'body' => $response->getBody()->getContents(),
|
||||
'username' => $this->username,
|
||||
'headers' => $response->getHeaders()
|
||||
]);
|
||||
return '';
|
||||
}
|
||||
$body = $response->getBody()->getContents();
|
||||
@ -68,8 +74,12 @@ class Login
|
||||
throw new Exception('Token not valid');
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
$this->logger->error($exception);
|
||||
$this->logger->notice($exception);
|
||||
$token = $this->login();
|
||||
if ($token === '') {
|
||||
unlink($this->tokenFilename);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return implode('', [md5($apiKey), $separator, $token]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user