diff --git a/core/modules/rest/src/Plugin/ResourceBase.php b/core/modules/rest/src/Plugin/ResourceBase.php index 0babfb7..9aeec30 100644 --- a/core/modules/rest/src/Plugin/ResourceBase.php +++ b/core/modules/rest/src/Plugin/ResourceBase.php @@ -221,7 +221,7 @@ protected function getBaseRoute($canonical_path, $method) { * * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException */ - protected function restFloodControl($config, $event) { + protected function restFloodControl($config, $name) { $limit = $config->get('user_limit'); $interval = $config->get('user_window'); if (!\Drupal::flood()->isAllowed($name, $limit, $interval)) { diff --git a/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php b/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php index 966897e..7a70ffd 100644 --- a/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php @@ -38,7 +38,7 @@ public function post(array $operation = array()) { if (!empty($operation['credentials'])) { return $this->login($operation['credentials']); } - return new ResourceResponse('Missing name and pass.', 400, array()); + return new ResourceResponse('credentials.', 400, array()); case 'logout': return $this->logout(); @@ -58,11 +58,11 @@ public function post(array $operation = array()) { protected function login(array $credentials = array()) { // Verify that the username is filled. if (!array_key_exists('name', $credentials)) { - return new ResourceResponse('Missing username.', 400, array()); + return new ResourceResponse('Missing credentials.name.', 400, array()); } // Verify that the username is filled. if (!array_key_exists('pass', $credentials)) { - return new ResourceResponse('Missing pass.', 400, array()); + return new ResourceResponse('Missing credentials.pass.', 400, array()); } // Flood control. @@ -90,4 +90,4 @@ protected function logout() { return new ResourceResponse('Logged out!', 200, array()); } -} \ No newline at end of file +}