Skip to content

Commit 193acaa

Browse files
authored
Merge pull request pterodactyl#76 from Pterodactyl/feature/laravel-5.3
Laravel 5.3
2 parents b274b40 + 6a8f722 commit 193acaa

38 files changed

+735
-1596
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ This file is a running track of new features and fixes to each version of the pa
1717
* [Security Patch] Fixes listing of server variables for server. Previously a bug made it possible to view settings for all servers, even if the user didn't own that server. (#69)
1818
* Prevent calling daemon until database call has been confirmed when changing default connection.
1919
* Fixes a few display issues relating to subusers and database management.
20+
21+
### General
22+
* Update Laravel to version `5.3` and update dependencies. **[BREAKING]** This removes the remote API from the panel due to Dingo API instability. This message will be removed when it is added back.

app/Exceptions/Handler.php

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
use DisplayValidationException;
88
use AccountNotFoundException;
99

10-
use Illuminate\Database\Eloquent\ModelNotFoundException;
11-
use Symfony\Component\HttpKernel\Exception\HttpException;
12-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
13-
use Illuminate\Auth\Access\AuthorizationException;
14-
use Illuminate\Foundation\Validation\ValidationException;
15-
10+
use Illuminate\Auth\AuthenticationException;
1611
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
1712

1813
class Handler extends ExceptionHandler
@@ -23,10 +18,12 @@ class Handler extends ExceptionHandler
2318
* @var array
2419
*/
2520
protected $dontReport = [
26-
HttpException::class,
27-
ModelNotFoundException::class,
28-
ValidationException::class,
29-
AuthorizationException::class,
21+
\Illuminate\Auth\AuthenticationException::class,
22+
\Illuminate\Auth\Access\AuthorizationException::class,
23+
\Symfony\Component\HttpKernel\Exception\HttpException::class,
24+
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
25+
\Illuminate\Session\TokenMismatchException::class,
26+
\Illuminate\Validation\ValidationException::class,
3027
];
3128

3229
/**
@@ -37,9 +34,9 @@ class Handler extends ExceptionHandler
3734
* @param \Exception $e
3835
* @return void
3936
*/
40-
public function report(Exception $e)
37+
public function report(Exception $exception)
4138
{
42-
return parent::report($e);
39+
return parent::report($exception);
4340
}
4441

4542
/**
@@ -83,4 +80,20 @@ public function render($request, Exception $e)
8380

8481
return parent::render($request, $e);
8582
}
83+
84+
/**
85+
* Convert an authentication exception into an unauthenticated response.
86+
*
87+
* @param \Illuminate\Http\Request $request
88+
* @param \Illuminate\Auth\AuthenticationException $exception
89+
* @return \Illuminate\Http\Response
90+
*/
91+
protected function unauthenticated($request, AuthenticationException $exception)
92+
{
93+
if ($request->expectsJson()) {
94+
return response()->json(['error' => 'Unauthenticated.'], 401);
95+
}
96+
return redirect()->guest('/auth/login');
97+
}
98+
8699
}

app/Http/Controllers/API/BaseController.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/Http/Controllers/API/LocationController.php

Lines changed: 0 additions & 64 deletions
This file was deleted.

app/Http/Controllers/API/NodeController.php

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)