Skip to content

Commit

Permalink
If the token is actually a path to the file, fetch the contents.
Browse files Browse the repository at this point in the history
  • Loading branch information
maclof committed Jul 8, 2017
1 parent b8c0126 commit 08164e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ protected function createGuzzleClient()
$options['ssl_key'] = $this->clientKey;
}
if ($this->token) {
$options['headers']['Authorization'] = 'Bearer ' . $this->token;
$token = $this->token;
if (file_exists($this->token)) {
$token = file_get_contents($this->token);
}

$options['headers']['Authorization'] = 'Bearer ' . $token;
}
if ($this->username && $this->password) {
$options['auth'] = [
Expand Down

0 comments on commit 08164e3

Please sign in to comment.