Skip to content

Commit

Permalink
Bugfixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanersu authored Dec 6, 2018
1 parent dbfe3a6 commit de830fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ public function __construct($config)
{
$this->config = $config;
$this->company_id = $this->config['company_id'];
$this->checkTokens();
if (function_exists('storage_path')) {
$this->file = storage_path('token.ini');
}
$this->checkTokens();
}

public function checkTokens()
{
try {
$tokens = parse_ini_file($this->file);
} catch (\Exception $e) {
unlink($this->file);
@unlink($this->file);
}

if (! isset($tokens['access_token']) || ! isset($tokens['created_at'])) {
Expand Down

0 comments on commit de830fb

Please sign in to comment.