mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Check for headers only by default, also allow a token to be passed in
This commit is contained in:
		@@ -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;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user