Commits

Anonymous committed 5a3c2a7

Fixed supported scopes handling when grant_type is client_credentials. Scopes were always set to null.

Comments (0)

Files changed (1)

lib/OAuth2/OAuth2.php

     }
 
     if (!is_array($stored)) {
-      $stored = array();
+      $stored = array('scope' => $this->getVariable(self::CONFIG_SUPPORTED_SCOPES, null));
     }
 
-    $stored += array('scope' => NULL, 'data' => NULL);
+    $stored += array('scope' => null, 'data' => null);
 
     // Check scope, if provided
     if ($input["scope"] && (!isset($stored["scope"]) || !$this->checkScope($input["scope"], $stored["scope"]))) {