mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 18:19:47 +05:30
Various bug fixes
This commit is contained in:
parent
f481a9baeb
commit
562c257596
@ -5,6 +5,7 @@ namespace OAuth2;
|
||||
use OutOfBoundsException;
|
||||
use OAuth2\Storage\SessionInterface;
|
||||
use OAuth2\Storage\SessionScopeInterface;
|
||||
use OAuth2\Util\RequestInterface;
|
||||
|
||||
class ResourceServer
|
||||
{
|
||||
@ -30,10 +31,9 @@ class ResourceServer
|
||||
* @param SessionInterface The Session Storage Object
|
||||
* @param SessionScopeInterface The Session Scope Storage Object
|
||||
*/
|
||||
public function __construct(SessionInterface $session, SessionScopeInterface $session_scope)
|
||||
public function __construct(SessionInterface $session)
|
||||
{
|
||||
$this->storages['session'] = $session;
|
||||
$this->storages['session_scope'] = $session_scope;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,12 +54,24 @@ class ResourceServer
|
||||
public function getRequest()
|
||||
{
|
||||
if ($this->request === null) {
|
||||
// @codeCoverageIgnoreStart
|
||||
$this->request = Request::buildFromGlobals();
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getTokenKey()
|
||||
{
|
||||
return $this->tokenKey;
|
||||
}
|
||||
|
||||
public function setTokenKey($key)
|
||||
{
|
||||
$this->tokenKey = $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Owner ID.
|
||||
*
|
||||
@ -77,7 +89,7 @@ class ResourceServer
|
||||
*/
|
||||
public function getOwnerType()
|
||||
{
|
||||
return $this->ownerId;
|
||||
return $this->ownerType;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,7 +122,7 @@ class ResourceServer
|
||||
$this->ownerType = $result['owner_type'];
|
||||
$this->ownerId = $result['owner_id'];
|
||||
|
||||
$this->sessionScopes = $this->storages['session_scope']->getScopes($this->sessionId);
|
||||
$this->sessionScopes = $this->storages['session']->getScopes($this->sessionId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user