728x90
오류내용
production.ERROR: The resource owner or authorization server denied the request. {"exception":"[object] (League\\OAuth2\\Server\\Exception\\OAuthServerException(code: 9): The resource owner or authorization server denied the request. at vendor/league/oauth2-server/src/Exception/OAuthServerException.php:243)
해결
app/Exceptions/Handler.php 에 두가지 추가!
protected $dontReport = [
//
\League\OAuth2\Server\Exception\OAuthServerException::class
];
public function report(Throwable $e)
{
if ($e instanceof \League\OAuth2\Server\Exception\OAuthServerException && $e->getCode() == 9) {
return ;
}
parent::report($e); // TODO: Change the autogenerated stub
}
다른 사이트 보면 report에 Exception 을 넣어서 수정하라고 한 경우가 많은데 버전 8에서는 Throwable로 기본이 변경되었다.
전체 코드
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
\League\OAuth2\Server\Exception\OAuthServerException::class
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
public function report(Throwable $e)
{
if ($e instanceof \League\OAuth2\Server\Exception\OAuthServerException && $e->getCode() == 9) {
return ;
}
parent::report($e); // TODO: Change the autogenerated stub
}
}
728x90
'SERVER > LARAVEL & PHP' 카테고리의 다른 글
[error] laravel nginx CSRF token mismatch. (0) | 2021.08.17 |
---|---|
The \"\" file does not exist or is not readable 오류 해결 (0) | 2021.08.04 |
PHP CURL GET방식 POST방식 정리 (0) | 2021.03.09 |
laravel aws redis connect (0) | 2021.01.21 |
Laravel + vuejs Access to XMLHttpRequest at been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 오류 해결 (0) | 2021.01.21 |