Check for headers only by default, also allow a token to be passed in

This commit is contained in:
Alex Bilbie 2014-01-17 17:17:13 +00:00
parent c5f48782e6
commit e4622b1f65

View File

@ -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;
} }