1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 17:12:30 +01:00

Treat unauthenticated exceptions the same as everything else

This commit is contained in:
Dane Everitt 2018-07-14 22:42:38 -07:00
parent aba1b297c8
commit a7fae86e58
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -231,7 +231,7 @@ class Handler extends ExceptionHandler
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
return response()->json(self::convertToArray($exception), 401);
}
return redirect()->guest(route('auth.login'));