mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
support grant specific access token ttl
This commit is contained in:
@@ -217,7 +217,7 @@ class AuthCodeGrant extends AbstractGrant
|
||||
// Generate the access token
|
||||
$accessToken = new AccessTokenEntity($this->server);
|
||||
$accessToken->setId(SecureKey::generate());
|
||||
$accessToken->setExpireTime($this->server->getAccessTokenTTL() + time());
|
||||
$accessToken->setExpireTime($this->getAccessTokenTTL() + time());
|
||||
|
||||
foreach ($authCodeScopes as $authCodeScope) {
|
||||
$session->associateScope($authCodeScope);
|
||||
@@ -228,7 +228,7 @@ class AuthCodeGrant extends AbstractGrant
|
||||
}
|
||||
|
||||
$this->server->getTokenType()->set('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());
|
||||
$this->server->getTokenType()->set('expires_in', $this->getAccessTokenTTL());
|
||||
|
||||
// Associate a refresh token if set
|
||||
if ($this->server->hasGrantType('refresh_token')) {
|
||||
|
||||
Reference in New Issue
Block a user