Skip to content

Commit

Permalink
fix authentication required after 1 day
Browse files Browse the repository at this point in the history
  • Loading branch information
coolcodemy committed Sep 14, 2017
1 parent ea3fc83 commit 142808d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/BackblazeAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

class BackblazeAdapter extends AbstractAdapter
{

use NotSupportingVisibilityTrait;

protected $client;

protected $accountId;
protected $applicationKey;
protected $bucketName;

public function __construct(Client $client, $bucketName)
public function __construct($accountId, $applicationKey, $bucketName)
{
$this->client = $client;
$this->bucketName = $bucketName;
$this->accountId = $accountId;
$this->applicationKey = $applicationKey;
$this->bucketName = $bucketName;
}

/**
Expand Down Expand Up @@ -207,7 +207,7 @@ public function getTimestamp($path)
*/
public function getClient()
{
return $this->client;
return new Client($this->accountId, $this->applicationKey);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/BackblazeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace RunCloudIO\FlysystemB2;

use ChrisWhite\B2\Client;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
Expand All @@ -19,8 +18,7 @@ public function boot()
isset($config['bucketName']))) {
throw new \Exception('Please set all configuration keys. (accountId, applicationKey, bucketName)');
}
$client = new Client($config['accountId'], $config['applicationKey']);
$adapter = new BackblazeAdapter($client, $config['bucketName']);
$adapter = new BackblazeAdapter($config['accountId'], $config['applicationKey'], $config['bucketName']);
return new Filesystem($adapter);
});
}
Expand Down

0 comments on commit 142808d

Please sign in to comment.