mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 17:56:14 +05:30
Broke expiration DateTime out into seperate variable for readability
This commit is contained in:
parent
385b03db6f
commit
90d18c553d
@ -273,7 +273,8 @@ class AuthCodeGrant extends AbstractGrant
|
|||||||
// Generate the access token
|
// Generate the access token
|
||||||
$accessToken = new AccessTokenEntity($this->server);
|
$accessToken = new AccessTokenEntity($this->server);
|
||||||
$accessToken->setIdentifier(SecureKey::generate());
|
$accessToken->setIdentifier(SecureKey::generate());
|
||||||
$accessToken->setExpiryDateTime((new \DateTime)->add($accessTokenTTL));
|
$expirationDateTime = (new \DateTime())->add($accessTokenTTL);
|
||||||
|
$accessToken->setExpiryDateTime($expirationDateTime);
|
||||||
$accessToken->setClient($client);
|
$accessToken->setClient($client);
|
||||||
|
|
||||||
foreach ($code->getScopes() as $scope) {
|
foreach ($code->getScopes() as $scope) {
|
||||||
|
@ -82,7 +82,8 @@ class ClientCredentialsGrant extends AbstractGrant
|
|||||||
// Generate an access token
|
// Generate an access token
|
||||||
$accessToken = new AccessTokenEntity();
|
$accessToken = new AccessTokenEntity();
|
||||||
$accessToken->setIdentifier(SecureKey::generate());
|
$accessToken->setIdentifier(SecureKey::generate());
|
||||||
$accessToken->setExpiryDateTime((new \DateTime())->add($accessTokenTTL));
|
$expirationDateTime = (new \DateTime())->add($accessTokenTTL);
|
||||||
|
$accessToken->setExpiryDateTime($expirationDateTime);
|
||||||
$accessToken->setClient($client);
|
$accessToken->setClient($client);
|
||||||
$accessToken->setOwner('client', $client->getIdentifier());
|
$accessToken->setOwner('client', $client->getIdentifier());
|
||||||
|
|
||||||
|
@ -147,7 +147,8 @@ class PasswordGrant extends AbstractGrant
|
|||||||
// Generate an access token
|
// Generate an access token
|
||||||
$accessToken = new AccessTokenEntity();
|
$accessToken = new AccessTokenEntity();
|
||||||
$accessToken->setIdentifier(SecureKey::generate());
|
$accessToken->setIdentifier(SecureKey::generate());
|
||||||
$accessToken->setExpiryDateTime((new \DateTime())->add($accessTokenTTL));
|
$expirationDateTime = (new \DateTime())->add($accessTokenTTL);
|
||||||
|
$accessToken->setExpiryDateTime($expirationDateTime);
|
||||||
$accessToken->setOwner('user', $user->getIdentifier());
|
$accessToken->setOwner('user', $user->getIdentifier());
|
||||||
$accessToken->setClient($client);
|
$accessToken->setClient($client);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user