Skip to content

Commit 3abcba8

Browse files
committed
Merge pull request #195 from sebmak/rewrite
Updated the error handler to work with the latest version of Laravel 5.0
2 parents aa0e745 + 30a68d7 commit 3abcba8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/OAuth2ServerServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use LucaDegasperi\OAuth2Server\Filters\CheckAuthCodeRequestFilter;
1818
use LucaDegasperi\OAuth2Server\Filters\OAuthFilter;
1919
use LucaDegasperi\OAuth2Server\Filters\OAuthOwnerFilter;
20+
use Illuminate\Contracts\Exception\Handler;
2021

2122
class OAuth2ServerServiceProvider extends ServiceProvider
2223
{
@@ -30,10 +31,10 @@ class OAuth2ServerServiceProvider extends ServiceProvider
3031
* Bootstrap the application events.
3132
* @return void
3233
*/
33-
public function boot()
34+
public function boot(Handler $handler)
3435
{
3536
$this->package('lucadegasperi/oauth2-server-laravel', 'oauth2-server-laravel', __DIR__.'/');
36-
37+
$this->registerErrorHandlers($handler);
3738
$this->bootFilters();
3839
}
3940

@@ -43,7 +44,6 @@ public function boot()
4344
*/
4445
public function register()
4546
{
46-
$this->registerErrorHandlers();
4747
$this->registerAuthorizer();
4848
$this->registerFilterBindings();
4949
$this->registerCommands();
@@ -162,9 +162,9 @@ private function bootFilters()
162162
* Register the OAuth error handlers
163163
* @return void
164164
*/
165-
private function registerErrorHandlers()
165+
private function registerErrorHandlers(Handler $handler)
166166
{
167-
$this->app->error(function(OAuthException $e) {
167+
$handler->error(function(OAuthException $e) {
168168
return new JsonResponse([
169169
'error' => $e->errorType,
170170
'error_description' => $e->getMessage()

0 commit comments

Comments
 (0)