Skip to content

Commit

Permalink
Add recaptcha check to sandbox API
Browse files Browse the repository at this point in the history
  • Loading branch information
addshore committed Dec 10, 2020
1 parent ea6f924 commit 39e650a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/Http/Controllers/Sandbox/SandboxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;

class SandboxController extends Controller {
Expand All @@ -27,11 +28,14 @@ class SandboxController extends Controller {

public function create( Request $request)
{
$validation = [
'recaptcha' => 'required|captcha',
];
$validator = Validator::make($request->all(), $validation);
$validator->validate();

$domain = $this->generateDomain();

// TODO Recaptcha

$wiki = null;
DB::transaction(function () use (&$wiki, $domain) {
$wikiDbCondition = ['wiki_id'=>null,'version'=> self::MW_VERSION ];
Expand Down

0 comments on commit 39e650a

Please sign in to comment.