mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Class rename fixes
This commit is contained in:
		@@ -2,8 +2,7 @@
 | 
			
		||||
 | 
			
		||||
use League\OAuth2\Server\Exception\OAuthServerException;
 | 
			
		||||
use League\OAuth2\Server\Grant\AuthCodeGrant;
 | 
			
		||||
use League\OAuth2\Server\RequestTypes\AuthorizationRequest;
 | 
			
		||||
use League\OAuth2\Server\Server;
 | 
			
		||||
use League\OAuth2\Server\AuthorizationServer;
 | 
			
		||||
use OAuth2ServerExamples\Entities\UserEntity;
 | 
			
		||||
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
 | 
			
		||||
use OAuth2ServerExamples\Repositories\AuthCodeRepository;
 | 
			
		||||
@@ -21,7 +20,7 @@ $app = new App([
 | 
			
		||||
    'settings'    => [
 | 
			
		||||
        'displayErrorDetails' => true,
 | 
			
		||||
    ],
 | 
			
		||||
    Server::class => function () {
 | 
			
		||||
    AuthorizationServer::class => function () {
 | 
			
		||||
        // Init our repositories
 | 
			
		||||
        $clientRepository = new ClientRepository();
 | 
			
		||||
        $scopeRepository = new ScopeRepository();
 | 
			
		||||
@@ -33,7 +32,7 @@ $app = new App([
 | 
			
		||||
        $publicKeyPath = 'file://' . __DIR__ . '/../public.key';
 | 
			
		||||
 | 
			
		||||
        // Setup the authorization server
 | 
			
		||||
        $server = new Server(
 | 
			
		||||
        $server = new AuthorizationServer(
 | 
			
		||||
            $clientRepository,
 | 
			
		||||
            $accessTokenRepository,
 | 
			
		||||
            $scopeRepository,
 | 
			
		||||
@@ -56,8 +55,8 @@ $app = new App([
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
$app->get('/authorize', function (ServerRequestInterface $request, ResponseInterface $response) use ($app) {
 | 
			
		||||
    /* @var \League\OAuth2\Server\Server $server */
 | 
			
		||||
    $server = $app->getContainer()->get(Server::class);
 | 
			
		||||
    /* @var \League\OAuth2\Server\AuthorizationServer $server */
 | 
			
		||||
    $server = $app->getContainer()->get(AuthorizationServer::class);
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
        // Validate the HTTP request and return an AuthorizationRequest object.
 | 
			
		||||
@@ -84,8 +83,8 @@ $app->get('/authorize', function (ServerRequestInterface $request, ResponseInter
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
$app->post('/access_token', function (ServerRequestInterface $request, ResponseInterface $response) use ($app) {
 | 
			
		||||
    /* @var \League\OAuth2\Server\Server $server */
 | 
			
		||||
    $server = $app->getContainer()->get(Server::class);
 | 
			
		||||
    /* @var \League\OAuth2\Server\AuthorizationServer $server */
 | 
			
		||||
    $server = $app->getContainer()->get(AuthorizationServer::class);
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
        return $server->respondToAccessTokenRequest($request, $response);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user