Skip to content

Commit f9e477a

Browse files
committed
* Invalid token returns 401 Unauthorized, instead of 403 Forbidden, as defined in section 3.1 Error Codes of https://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23
1 parent c042aa9 commit f9e477a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
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) {

0 commit comments

Comments
 (0)