mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 17:56:14 +05:30
Check for headers only by default, also allow a token to be passed in
This commit is contained in:
parent
c5f48782e6
commit
e4622b1f65
@ -133,10 +133,10 @@ class Resource extends AbstractServer
|
|||||||
* @param $headersOnly Limit Access Token to Authorization header only
|
* @param $headersOnly Limit Access Token to Authorization header only
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isValid($headersOnly = false)
|
public function isValid($headersOnly = true, $accessToken = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$accessTokenString = $this->determineAccessToken($headersOnly);
|
$accessTokenString = ($accessToken !== null) ? $accessToken : $this->determineAccessToken($headersOnly, $accessToken);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user