mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Inject the session into the token type
This commit is contained in:
@@ -230,6 +230,7 @@ class AuthCodeGrant extends AbstractGrant
|
||||
$accessToken->associateScope($scope);
|
||||
}
|
||||
|
||||
$this->server->getTokenType()->setSession($session);
|
||||
$this->server->getTokenType()->setParam('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ class ClientCredentialsGrant extends AbstractGrant
|
||||
$accessToken->setSession($session);
|
||||
$accessToken->save($this->server->getStorage('access_token'));
|
||||
|
||||
$this->server->getTokenType()->setSession($session);
|
||||
$this->server->getTokenType()->setParam('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
|
||||
|
||||
|
||||
@@ -148,6 +148,7 @@ class PasswordGrant extends AbstractGrant
|
||||
$accessToken->associateScope($scope);
|
||||
}
|
||||
|
||||
$this->server->getTokenType()->setSession($session);
|
||||
$this->server->getTokenType()->setParam('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ class RefreshTokenGrant extends AbstractGrant
|
||||
$oldAccessToken->expire($this->server->getStorage('access_token'));
|
||||
$newAccessToken->save($this->server->getStorage('access_token'));
|
||||
|
||||
$this->server->getTokenType()->setSession($session);
|
||||
$this->server->getTokenType()->setParam('access_token', $newAccessToken->getId());
|
||||
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user