Treat unauthenticated exceptions the same as everything else
This commit is contained in:
parent
aba1b297c8
commit
a7fae86e58
1 changed files with 1 additions and 1 deletions
|
@ -231,7 +231,7 @@ class Handler extends ExceptionHandler
|
||||||
protected function unauthenticated($request, AuthenticationException $exception)
|
protected function unauthenticated($request, AuthenticationException $exception)
|
||||||
{
|
{
|
||||||
if ($request->expectsJson()) {
|
if ($request->expectsJson()) {
|
||||||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
return response()->json(self::convertToArray($exception), 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->guest(route('auth.login'));
|
return redirect()->guest(route('auth.login'));
|
||||||
|
|
Loading…
Reference in a new issue