diff options
Diffstat (limited to 'infrastructure/Auth/Middleware/AccessTokenChecker.php')
-rw-r--r-- | infrastructure/Auth/Middleware/AccessTokenChecker.php | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/infrastructure/Auth/Middleware/AccessTokenChecker.php b/infrastructure/Auth/Middleware/AccessTokenChecker.php deleted file mode 100644 index f79f5cb..0000000 --- a/infrastructure/Auth/Middleware/AccessTokenChecker.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Infrastructure\Auth\Middleware; - -use Closure; -use Illuminate\Foundation\Application; -use Illuminate\Auth\Middleware\Authenticate; -use Illuminate\Auth\AuthenticationException; -use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; - -class AccessTokenChecker -{ - private $app; - - private $oAuthMiddleware; - - public function __construct( - Application $app, - Authenticate $authenticate - ) { - $this->app = $app; - $this->authenticate = $authenticate; - } - - public function handle($request, Closure $next, $scopesString = null) - { - if ($this->app->environment() !== 'testing') { - try { - return $this->authenticate->handle($request, $next, 'api'); - } catch (AuthenticationException $e) { - throw new UnauthorizedHttpException('Challenge'); - } - } - - return $next($request); - } -} |