From 143aeea444187b6019cef0bb6c742fa0c725ca7a Mon Sep 17 00:00:00 2001 From: JStojiljkovic Date: Sun, 25 Sep 2022 12:33:12 +0200 Subject: [PATCH] Update JwtGuard.php --- src/Services/Auth/JwtGuard.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/Auth/JwtGuard.php b/src/Services/Auth/JwtGuard.php index 5c0b04a..9a20817 100644 --- a/src/Services/Auth/JwtGuard.php +++ b/src/Services/Auth/JwtGuard.php @@ -3,6 +3,7 @@ namespace GrapheneICT\CognitoGuard\Services\Auth; use ErrorException; +use GrapheneICT\CognitoGuard\Exceptions\InvalidTokenException; use GrapheneICT\CognitoGuard\Services\CognitoService; use GrapheneICT\CognitoGuard\Services\JwtService; use Illuminate\Auth\GuardHelpers; @@ -44,7 +45,7 @@ public function user() $token = $this->request->bearerToken(); if (! $token) { - abort(403, 'Token is missing'); + throw new InvalidTokenException('Token is missing'); } $jwtService = new JwtService();