Skip to content

Commit

Permalink
magento#15564 Generated admin API token expires immediately
Browse files Browse the repository at this point in the history
When admin token lifetime setting is empty, the token will expire
immediatly
  • Loading branch information
krukas authored and vijay-wagento committed Jun 4, 2018
1 parent 943e2cd commit 7f34b22
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ private function isTokenExpired(Token $token): bool
// other user-type tokens are considered always valid
return false;
}

if (empty($tokenTtl)) {
return false;
}

if ($this->dateTime->strToTime($token->getCreatedAt()) < ($this->date->gmtTimestamp() - $tokenTtl * 3600)) {
return true;
}
Expand Down

0 comments on commit 7f34b22

Please sign in to comment.