FIX: Authorization en FastCGI
This commit is contained in:
@ -10,7 +10,7 @@ class Login
|
||||
{
|
||||
public function __construct(protected ClientInterface $client, protected LoggerInterface $logger,
|
||||
protected string $tokenFilename,
|
||||
protected string $username, protected string $password) {}
|
||||
protected string $username, protected string $password, protected string $apiKey) {}
|
||||
|
||||
public function login(): string
|
||||
{
|
||||
@ -84,8 +84,11 @@ class Login
|
||||
}
|
||||
return $response->getStatusCode() === 200;
|
||||
}
|
||||
public function getKey(string $apiKey, string $separator = 'g'): string
|
||||
public function getKey(?string $apiKey = null, string $separator = 'g'): string
|
||||
{
|
||||
if ($apiKey === null) {
|
||||
$apiKey = $this->apiKey;
|
||||
}
|
||||
try {
|
||||
$savedToken = $this->retrieveToken();
|
||||
$token = implode('', [md5($apiKey), $separator, $savedToken]);
|
||||
|
Reference in New Issue
Block a user