mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 17:56:14 +05:30
Removed dead code
This commit is contained in:
parent
1c2ec943e9
commit
e37289231d
@ -137,21 +137,21 @@ class RefreshTokenGrant extends AbstractGrant
|
|||||||
|
|
||||||
// Expire the old token and save the new one
|
// Expire the old token and save the new one
|
||||||
$oldAccessToken->expire($this->server->getStorage('access_token'));
|
$oldAccessToken->expire($this->server->getStorage('access_token'));
|
||||||
$newAccessToken->save($this->server->getStorage('access_token'));
|
$newAccessToken->save();
|
||||||
|
|
||||||
$this->server->getTokenType()->setSession($session);
|
$this->server->getTokenType()->setSession($session);
|
||||||
$this->server->getTokenType()->setParam('access_token', $newAccessToken->getId());
|
$this->server->getTokenType()->setParam('access_token', $newAccessToken->getId());
|
||||||
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
|
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
|
||||||
|
|
||||||
// Expire the old refresh token
|
// Expire the old refresh token
|
||||||
$oldRefreshToken->expire($this->server->getStorage('refresh_token'));
|
$oldRefreshToken->expire();
|
||||||
|
|
||||||
// Generate a new refresh token
|
// Generate a new refresh token
|
||||||
$newRefreshToken = new RefreshTokenEntity($this->server);
|
$newRefreshToken = new RefreshTokenEntity($this->server);
|
||||||
$newRefreshToken->setId(SecureKey::generate());
|
$newRefreshToken->setId(SecureKey::generate());
|
||||||
$newRefreshToken->setExpireTime($this->getRefreshTokenTTL() + time());
|
$newRefreshToken->setExpireTime($this->getRefreshTokenTTL() + time());
|
||||||
$newRefreshToken->setAccessToken($newAccessToken);
|
$newRefreshToken->setAccessToken($newAccessToken);
|
||||||
$newRefreshToken->save($this->server->getStorage('refresh_token'));
|
$newRefreshToken->save();
|
||||||
|
|
||||||
$this->server->getTokenType()->setParam('refresh_token', $newRefreshToken->getId());
|
$this->server->getTokenType()->setParam('refresh_token', $newRefreshToken->getId());
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ class ResourceServer extends AbstractServer
|
|||||||
{
|
{
|
||||||
$accessTokenString = ($accessToken !== null)
|
$accessTokenString = ($accessToken !== null)
|
||||||
? $accessToken
|
? $accessToken
|
||||||
: $this->determineAccessToken($headersOnly, $accessToken);
|
: $this->determineAccessToken($headersOnly);
|
||||||
|
|
||||||
// Set the access token
|
// Set the access token
|
||||||
$this->accessToken = $this->storages['access_token']->get($accessTokenString);
|
$this->accessToken = $this->storages['access_token']->get($accessTokenString);
|
||||||
|
Loading…
Reference in New Issue
Block a user