Skip to content

Commit

Permalink
[BUGFIX] #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 committed May 30, 2018
1 parent 323994f commit eab3674
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,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 eab3674

Please sign in to comment.