From e4622b1f65ee550056ce14f480c1d642d182dfc2 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 17 Jan 2014 17:17:13 +0000 Subject: [PATCH] Check for headers only by default, also allow a token to be passed in --- src/League/OAuth2/Server/Resource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/League/OAuth2/Server/Resource.php b/src/League/OAuth2/Server/Resource.php index 8c7af57c..5160bf70 100644 --- a/src/League/OAuth2/Server/Resource.php +++ b/src/League/OAuth2/Server/Resource.php @@ -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; }