Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 454d11f

Browse files
committed
ReCaptchaController@validateV3 action associated to biscolab-recaptcha/validate route
1 parent 451d9e6 commit 454d11f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/ReCaptchaBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function htmlScriptTagJsApiV3(?array $configuration = []): string {
216216
*
217217
* @param string $response
218218
*
219-
* @return boolean
219+
* @return boolean|array
220220
*/
221221
public function validate($response) {
222222

src/routes/routes.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
* MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
99
*/
1010

11-
Route::get(config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate'), function () {
12-
13-
$token = request()->input(config('recaptcha.default_token_parameter_name', 'token'), '');
14-
$validation_response = recaptcha()->validate($token);
15-
16-
return response()->json($validation_response);
17-
})->middleware('web');
11+
Route::get(
12+
config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate'),
13+
['uses' => 'Biscolab\ReCaptcha\Controllers\ReCaptchaController@validateV3']
14+
)->middleware('web');

0 commit comments

Comments
 (0)