diff --git a/src/OAuth2/Resource.php b/src/OAuth2/Resource.php index 6c1cea3..c8bfb13 100644 --- a/src/OAuth2/Resource.php +++ b/src/OAuth2/Resource.php @@ -4,7 +4,7 @@ namespace Pickles\OAuth2; use \League\OAuth2\Server\AuthorizationServer; use \League\OAuth2\Server\Grant\PasswordGrant; -use \Pickles\App\Model\User; +use \Pickles\App\Models\User; class Resource extends \Pickles\Resource { diff --git a/src/Resource.php b/src/Resource.php index a8e04ad..51e6565 100644 --- a/src/Resource.php +++ b/src/Resource.php @@ -103,26 +103,6 @@ class Resource extends Object switch ($this->config['auth'][$_SERVER['__version']]['strategy']) { - case 'basic': - // @todo Check if Auth class has been implemented, if - // not, fallback to the parent - - // This class should be in the classes directory of the service - $auth = '\\' . $this->config['pickles']['namespace'] . '\\Classes\\Auth'; - - // Strips preceding slashs when there is no namespace - if (strpos($auth, '\\\\') === 0) - { - $auth = substr($auth, 2); - } - - // @todo Custom method - if (!$auth::basic()) - { - throw new \Exception('Invalid authentication credentials.', 401); - } - break; - default: throw new \Exception('Invalid authentication strategy.', 401); break; diff --git a/src/Router.php b/src/Router.php index d737f87..31ea2e8 100644 --- a/src/Router.php +++ b/src/Router.php @@ -69,15 +69,8 @@ class Router extends Object } // Creates our class name - array_unshift($nouns, '', $this->config['pickles']['namespace'], 'Resources', $version); + array_unshift($nouns, '', 'Pickles', 'App', 'Resources', $version); $class = implode('\\', $nouns); - - // @todo Make namespace mandatory - // Strips preceding slashs when there is no namespace - if (strpos($class, '\\\\') === 0) - { - $class = substr($class, 2); - } } // Checks that the file is present and contains our class