mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-02-09 18:25:54 +05:30
Removed id
property from token entities, just use token
now
This commit is contained in:
parent
2c732a6647
commit
e9d867ba95
@ -12,7 +12,7 @@ abstract class AbstractToken
|
|||||||
* Access token ID
|
* Access token ID
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $id = null;
|
protected $token = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access token storage
|
* Access token storage
|
||||||
@ -129,12 +129,12 @@ abstract class AbstractToken
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set access token ID
|
* Set access token ID
|
||||||
* @param string $id Token ID
|
* @param string $token Token ID
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setId($id = null)
|
public function setToken($token = null)
|
||||||
{
|
{
|
||||||
$this->id = ($id !== null) ? $id : SecureKey::make();
|
$this->token = ($token !== null) ? $token : SecureKey::make();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,9 +142,9 @@ abstract class AbstractToken
|
|||||||
* Get the token ID
|
* Get the token ID
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getToken()
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->token;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,14 +23,14 @@ class AccessToken extends AbstractToken
|
|||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
$this->getStorage()->createAccessToken(
|
$this->getStorage()->createAccessToken(
|
||||||
$this->getId(),
|
$this->getToken(),
|
||||||
$this->getExpireTime(),
|
$this->getExpireTime(),
|
||||||
$this->getSession()->getId()
|
$this->getSession()->getId()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associate the scope with the token
|
// Associate the scope with the token
|
||||||
foreach ($this->getScopes() as $scope) {
|
foreach ($this->getScopes() as $scope) {
|
||||||
$this->getStorage()->associateScope($this->getId(), $scope->getId());
|
$this->getStorage()->associateScope($this->getToken(), $scope->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -47,15 +47,15 @@ class RefreshToken extends AbstractToken
|
|||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
/*$this->getStorage()->createAccessToken(
|
$this->getStorage()->createAccessToken(
|
||||||
$this->getId(),
|
$this->getToken(),
|
||||||
$this->getExpireTime(),
|
$this->getExpireTime(),
|
||||||
$this->getAccessToken()->getId()
|
$this->getAccessToken()->getToken()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associate the scope with the token
|
// Associate the scope with the token
|
||||||
foreach ($this->getScopes() as $scope) {
|
foreach ($this->getScopes() as $scope) {
|
||||||
$this->getStorage()->associateScope($this->getId(), $scope->getId());
|
$this->getStorage()->associateScope($this->getToken(), $scope->getId());
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user