Moved to new namespace
This commit is contained in:
parent
2ec85c469b
commit
75596ed725
3 changed files with 2 additions and 29 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue