mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-27 07:20:18 +05:30
Merge pull request #553 from markinjapan/patch-1
Remove redundant parameters in getNewToken()
This commit is contained in:
commit
acf262f879
@ -43,15 +43,8 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null)
|
public function getNewToken()
|
||||||
{
|
{
|
||||||
$accessToken = new AccessTokenEntity();
|
return new AccessTokenEntity();
|
||||||
$accessToken->setClient($clientEntity);
|
|
||||||
foreach ($scopes as $scope) {
|
|
||||||
$accessToken->addScope($scope);
|
|
||||||
}
|
|
||||||
$accessToken->setUserIdentifier($userIdentifier);
|
|
||||||
|
|
||||||
return $accessToken;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ abstract class AbstractGrant implements GrantTypeInterface
|
|||||||
$userIdentifier,
|
$userIdentifier,
|
||||||
array $scopes = []
|
array $scopes = []
|
||||||
) {
|
) {
|
||||||
$accessToken = $this->accessTokenRepository->getNewToken($client, $scopes, $userIdentifier);
|
$accessToken = $this->accessTokenRepository->getNewToken();
|
||||||
$accessToken->setClient($client);
|
$accessToken->setClient($client);
|
||||||
$accessToken->setUserIdentifier($userIdentifier);
|
$accessToken->setUserIdentifier($userIdentifier);
|
||||||
$accessToken->setIdentifier($this->generateUniqueIdentifier());
|
$accessToken->setIdentifier($this->generateUniqueIdentifier());
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
namespace League\OAuth2\Server\Repositories;
|
namespace League\OAuth2\Server\Repositories;
|
||||||
|
|
||||||
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
|
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
|
||||||
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access token interface.
|
* Access token interface.
|
||||||
@ -20,13 +19,9 @@ interface AccessTokenRepositoryInterface extends RepositoryInterface
|
|||||||
/**
|
/**
|
||||||
* Create a new access token
|
* Create a new access token
|
||||||
*
|
*
|
||||||
* @param \League\OAuth2\Server\Entities\ClientEntityInterface $clientEntity
|
|
||||||
* @param \League\OAuth2\Server\Entities\ScopeEntityInterface[] $scopes
|
|
||||||
* @param mixed $userIdentifier
|
|
||||||
*
|
|
||||||
* @return AccessTokenEntityInterface
|
* @return AccessTokenEntityInterface
|
||||||
*/
|
*/
|
||||||
public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null);
|
public function getNewToken();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persists a new access token to permanent storage.
|
* Persists a new access token to permanent storage.
|
||||||
|
Loading…
Reference in New Issue
Block a user