Skip to content

Commit 0ec2177

Browse files
authored
Merge pull request #59155 from nextcloud/backport/59079/stable33
[stable33] fix(oauth2): Do not store the code in throttle metadata
2 parents 3ced2fa + 333d680 commit 0ec2177

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

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)