Skip to content

Commit

Permalink
Update OneDrive.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hevelius authored Aug 5, 2019
1 parent bc25b23 commit 3ba5850
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Storage/OneDrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ public function __construct($params)
$container = $app->getContainer();
$this->server = $container->getServer();

$this->token = json_decode(base64_decode($params['token']));
$this->token = json_decode(gzinflate(base64_decode($params['token'])));

if ($this->token !== null) {
$now = time() + 300;
if ($this->token->expires <= $now) {
$this->token = json_decode(base64_decode($this->refreshToken($this->token)));
$this->token = json_decode(gzinflate(base64_decode($this->refreshToken($this->token))));
}
}

Expand Down Expand Up @@ -180,7 +180,7 @@ public function refreshToken()
$newToken = json_decode($newToken, true);
$newToken['code_uid'] = $this->token->code_uid;

$newToken = base64_encode(json_encode($newToken));
$newToken = base64_encode(gzdeflate(json_encode($newToken), 9));

$user = $this->server->getUserSession()->getUser();

Expand Down

0 comments on commit 3ba5850

Please sign in to comment.