fix(oauth2): Do not store the code in throttle metadata

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-03-19 14:25:14 +01:00 committed by backportbot[bot]
parent d8b0c75cfb
commit bffb9affa8
2 changed files with 3 additions and 3 deletions

View file

@ -93,7 +93,7 @@ class OauthApiController extends Controller {
$response = new JSONResponse([
'error' => 'invalid_request',
], Http::STATUS_BAD_REQUEST);
$response->throttle(['invalid_request' => 'token not found', 'code' => $code]);
$response->throttle(['invalid_request' => 'token not found']);
return $response;
}

View file

@ -98,7 +98,7 @@ class OauthApiControllerTest extends TestCase {
$expected = new JSONResponse([
'error' => 'invalid_request',
], Http::STATUS_BAD_REQUEST);
$expected->throttle(['invalid_request' => 'token not found', 'code' => 'invalidcode']);
$expected->throttle(['invalid_request' => 'token not found']);
$this->accessTokenMapper->method('getByCode')
->with('invalidcode')
@ -194,7 +194,7 @@ class OauthApiControllerTest extends TestCase {
$expected = new JSONResponse([
'error' => 'invalid_request',
], Http::STATUS_BAD_REQUEST);
$expected->throttle(['invalid_request' => 'token not found', 'code' => 'invalidrefresh']);
$expected->throttle(['invalid_request' => 'token not found']);
$this->accessTokenMapper->method('getByCode')
->with('invalidrefresh')