Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
grafana
/
vendor
/
league
/
oauth2-server
/
src
/
Middleware
/
File Content:
AuthorizationServerMiddleware.php
<?php /** * @author Alex Bilbie <hello@alexbilbie.com> * @copyright Copyright (c) Alex Bilbie * @license http://mit-license.org/ * * @link https://github.com/thephpleague/oauth2-server */ declare (strict_types=1); namespace PleskGrafana\League\OAuth2\Server\Middleware; use PleskGrafana\League\OAuth2\Server\AuthorizationServer; use PleskGrafana\League\OAuth2\Server\Exception\OAuthServerException; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; class AuthorizationServerMiddleware { public function __construct(private AuthorizationServer $server) { } public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) : ResponseInterface { try { $response = $this->server->respondToAccessTokenRequest($request, $response); } catch (OAuthServerException $exception) { return $exception->generateHttpResponse($response); } // Pass the request and response on to the next responder in the chain return $next($request, $response); } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
AuthorizationServerMiddleware.php
1121 bytes
0644
ResourceServerMiddleware.php
1095 bytes
0644
N4ST4R_ID | Naxtarrr