Remove duplicate setting of expirydatetime

This commit is contained in:
sephster 2019-05-14 16:11:34 +01:00
parent 86d1581cd9
commit a1cf22a3a9
No known key found for this signature in database
GPG Key ID: 077754CA23023F4F

View File

@ -484,12 +484,12 @@ abstract class AbstractGrant implements GrantTypeInterface
protected function issueRefreshToken(AccessTokenEntityInterface $accessToken) protected function issueRefreshToken(AccessTokenEntityInterface $accessToken)
{ {
$refreshToken = $this->refreshTokenRepository->getNewRefreshToken(); $refreshToken = $this->refreshTokenRepository->getNewRefreshToken();
$refreshToken->setExpiryDateTime((new DateTimeImmutable())->add($this->refreshTokenTTL));
if ($refreshToken === null) { if ($refreshToken === null) {
return null; return null;
} }
$refreshToken->setExpiryDateTime((new DateTime())->add($this->refreshTokenTTL)); $refreshToken->setExpiryDateTime((new DateTimeImmutable())->add($this->refreshTokenTTL));
$refreshToken->setAccessToken($accessToken); $refreshToken->setAccessToken($accessToken);
$maxGenerationAttempts = self::MAX_RANDOM_TOKEN_GENERATION_ATTEMPTS; $maxGenerationAttempts = self::MAX_RANDOM_TOKEN_GENERATION_ATTEMPTS;