Skip to content

Commit 69db28c

Browse files
authored
Merge pull request #59079 from nextcloud/fix/do-not-store-auth-code
fix(oauth2): Do not store the code in throttle metadata
2 parents 18f03f6 + 5c1b58c commit 69db28c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/oauth2/lib/Controller/OauthApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getToken(
9393
$response = new JSONResponse([
9494
'error' => 'invalid_request',
9595
], Http::STATUS_BAD_REQUEST);
96-
$response->throttle(['invalid_request' => 'token not found', 'code' => $code]);
96+
$response->throttle(['invalid_request' => 'token not found']);
9797
return $response;
9898
}
9999

apps/oauth2/tests/Controller/OauthApiControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testGetTokenInvalidCode(): void {
9898
$expected = new JSONResponse([
9999
'error' => 'invalid_request',
100100
], Http::STATUS_BAD_REQUEST);
101-
$expected->throttle(['invalid_request' => 'token not found', 'code' => 'invalidcode']);
101+
$expected->throttle(['invalid_request' => 'token not found']);
102102

103103
$this->accessTokenMapper->method('getByCode')
104104
->with('invalidcode')
@@ -194,7 +194,7 @@ public function testRefreshTokenInvalidRefreshToken(): void {
194194
$expected = new JSONResponse([
195195
'error' => 'invalid_request',
196196
], Http::STATUS_BAD_REQUEST);
197-
$expected->throttle(['invalid_request' => 'token not found', 'code' => 'invalidrefresh']);
197+
$expected->throttle(['invalid_request' => 'token not found']);
198198

199199
$this->accessTokenMapper->method('getByCode')
200200
->with('invalidrefresh')

0 commit comments

Comments
 (0)