Add new exception to catch block
This commit is contained in:
parent
1406e8b520
commit
b7614d12c5
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ use App\Models\Place;
|
||||||
use App\Services\Micropub\{HCardService, HEntryService, UpdateService};
|
use App\Services\Micropub\{HCardService, HEntryService, UpdateService};
|
||||||
use App\Services\TokenService;
|
use App\Services\TokenService;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Lcobucci\JWT\Encoding\CannotDecodeContent;
|
||||||
use Lcobucci\JWT\Token\InvalidTokenStructure;
|
use Lcobucci\JWT\Token\InvalidTokenStructure;
|
||||||
use Lcobucci\JWT\Validation\RequiredConstraintsViolated;
|
use Lcobucci\JWT\Validation\RequiredConstraintsViolated;
|
||||||
use Monolog\Handler\StreamHandler;
|
use Monolog\Handler\StreamHandler;
|
||||||
|
@ -43,7 +44,7 @@ class MicropubController extends Controller
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$tokenData = $this->tokenService->validateToken(request()->input('access_token'));
|
$tokenData = $this->tokenService->validateToken(request()->input('access_token'));
|
||||||
} catch (RequiredConstraintsViolated | InvalidTokenStructure $exception) {
|
} catch (RequiredConstraintsViolated | InvalidTokenStructure | CannotDecodeContent $exception) {
|
||||||
$micropubResponses = new MicropubResponses();
|
$micropubResponses = new MicropubResponses();
|
||||||
|
|
||||||
return $micropubResponses->invalidTokenResponse();
|
return $micropubResponses->invalidTokenResponse();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue