Skip to content

Commit a7fae86

Browse files
committed
Treat unauthenticated exceptions the same as everything else
1 parent aba1b29 commit a7fae86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Exceptions/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public static function isReportable(Exception $exception): bool
231231
protected function unauthenticated($request, AuthenticationException $exception)
232232
{
233233
if ($request->expectsJson()) {
234-
return response()->json(['error' => 'Unauthenticated.'], 401);
234+
return response()->json(self::convertToArray($exception), 401);
235235
}
236236

237237
return redirect()->guest(route('auth.login'));

0 commit comments

Comments
 (0)