mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 10:41:51 +05:30
Removed service providers
This commit is contained in:
parent
1442842da9
commit
03e4ac7ea6
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Server\ServiceProviders;
|
||||
|
||||
use League\Container\ServiceProvider;
|
||||
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
||||
|
||||
class ClientCredentialsGrantProvider extends ServiceProvider
|
||||
{
|
||||
protected $provides = ['ClientCredentialsGrant'];
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$container = $this->getContainer();
|
||||
|
||||
$container->add('ClientCredentialsGrant', function () use ($container) {
|
||||
$grant = new ClientCredentialsGrant(
|
||||
$container->get('emitter'),
|
||||
$container->get('ClientRepository'),
|
||||
$container->get('ScopeRepository'),
|
||||
$container->get('AccessTokenRepository')
|
||||
);
|
||||
return $grant;
|
||||
});
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Server\ServiceProviders;
|
||||
|
||||
use League\Container\ServiceProvider;
|
||||
use League\OAuth2\Server\Grant\PasswordGrant;
|
||||
|
||||
class PasswordGrantProvider extends ServiceProvider
|
||||
{
|
||||
protected $provides = ['PasswordGrant'];
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$container = $this->getContainer();
|
||||
|
||||
$container->add('PasswordGrant', function () use ($container) {
|
||||
|
||||
$refreshTokenRepository = null;
|
||||
if ($container->isRegistered('RefreshTokenRepository')) {
|
||||
$refreshTokenRepository = $container->get('RefreshTokenRepository');
|
||||
}
|
||||
|
||||
$grant = new PasswordGrant(
|
||||
$container->get('emitter'),
|
||||
$container->get('ClientRepository'),
|
||||
$container->get('ScopeRepository'),
|
||||
$container->get('AccessTokenRepository'),
|
||||
$container->get('UserRepository'),
|
||||
$refreshTokenRepository
|
||||
);
|
||||
return $grant;
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user