Skip to content

Commit 7ca8e3e

Browse files
author
Luca Degasperi
committed
Merge pull request #72 from lucadegasperi/pr/71
Merging changes to the oauth filter
2 parents c042aa9 + f030e75 commit 7ca8e3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/LucaDegasperi/OAuth2Server/Filters/OAuthFilter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public function filter()
2121
ResourceServer::isValid(Config::get('lucadegasperi/oauth2-server-laravel::oauth2.http_headers_only'));
2222
} catch (\League\OAuth2\Server\Exception\InvalidAccessTokenException $e) {
2323
return Response::json(array(
24-
'status' => 403,
25-
'error' => 'forbidden',
24+
'status' => 401,
25+
'error' => 'unauthorized',
2626
'error_message' => $e->getMessage(),
27-
), 403);
27+
), 401);
2828
}
2929

3030
if (func_num_args() > 2) {

tests/OAuthFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function test_invalid_filter_with_no_scope()
2626

2727
$response = $this->getFilter()->filter('', '');
2828
$this->assertTrue($response instanceof Illuminate\Http\JsonResponse);
29-
$this->assertTrue($response->isForbidden());
29+
$this->assertEquals('401', $response->getStatusCode());
3030

3131
}
3232

0 commit comments

Comments
 (0)