Skip to content

Commit

Permalink
Fixed the token check method
Browse files Browse the repository at this point in the history
  • Loading branch information
Mridang Agarwalla authored and Mridang Agarwalla committed Jul 20, 2016
1 parent c6cb560 commit 8bc0293
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/classes/NostoAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,12 @@ public function isConnectedToNosto()
if (empty($this->tokens)) {
return false;
}
$countTokens = count($this->tokens);
$foundTokens = 0;
foreach (NostoApiToken::getApiTokenNames() as $name) {
foreach ($this->tokens as $token) {
if ($token->name === $name) {
$foundTokens++;
break;
}
if ($this->getApiToken($name) === null) {
return false;
}
}
return ($countTokens === $foundTokens);
return true;
}

/**
Expand Down

0 comments on commit 8bc0293

Please sign in to comment.