mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-15 17:58:56 +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
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid($headersOnly = false)
|
||||
public function isValid($headersOnly = true, $accessToken = null)
|
||||
{
|
||||
try {
|
||||
$accessTokenString = $this->determineAccessToken($headersOnly);
|
||||
$accessTokenString = ($accessToken !== null) ? $accessToken : $this->determineAccessToken($headersOnly, $accessToken);
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user