2020-05-30 02:29:54 +01:00
|
|
|
<?php
|
|
|
|
|
2020-05-30 03:18:43 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-05-30 02:29:54 +01:00
|
|
|
namespace Opdavies\Glassboxx\Request;
|
|
|
|
|
2020-05-30 16:45:40 +01:00
|
|
|
final class AuthTokenRequest extends AbstractRequest implements AuthTokenRequestInterface
|
2020-05-30 02:29:54 +01:00
|
|
|
{
|
|
|
|
public function getToken(): string
|
|
|
|
{
|
2020-05-30 16:45:40 +01:00
|
|
|
$response = $this->client->request(
|
|
|
|
'POST',
|
|
|
|
self::BASE_URL.self::ENDPOINT,
|
|
|
|
[
|
|
|
|
'query' => [
|
|
|
|
'password' => $this->config->getPassword(),
|
|
|
|
'username' => $this->config->getUsername(),
|
|
|
|
],
|
|
|
|
]
|
|
|
|
);
|
2020-05-30 02:29:54 +01:00
|
|
|
|
|
|
|
return json_decode($response->getContent());
|
|
|
|
}
|
|
|
|
}
|