Skip to content

Firefly III: a personal finances manager

Switch to unreported error to cut down on spam.

James Cole29f4c09a7b58
diff --git a/app/Http/Middleware/IsAdminApi.php b/app/Http/Middleware/IsAdminApi.php
index b5601105c6..2372aaec27 100644
--- a/app/Http/Middleware/IsAdminApi.php
+++ b/app/Http/Middleware/IsAdminApi.php
@@ -26,7 +26,7 @@ namespace FireflyIII\Http\Middleware;
use Closure;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
-use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Auth\AuthenticationException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@@ -41,6 +41,7 @@ class IsAdminApi
* @param null|string $guard
*
* @return mixed
+ * @throws AuthenticationException
*/
public function handle(Request $request, Closure $next, $guard = null)
{
@@ -53,12 +54,12 @@ class IsAdminApi
}
/** @var User $user */
- $user = auth()->user();
+ $user = auth()->user();
/** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class);
if (!$repository->hasRole($user, 'owner')) {
- throw new AuthorizationException();
+ throw new AuthenticationException();
}
return $next($request);