mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Feature/recaptcha v3 plus login (#202)
* [WIP] New GoogleReCAPTCHA code Support for v3 v2-invisible doesn't work yet * Add some notice about recaptchas versions * Lets support only ReCaptcha v3 Too much mess ;) * Fixes
This commit is contained in:
@@ -72,17 +72,12 @@ if($save)
|
||||
$errors['country'] = 'Country is invalid.';
|
||||
}
|
||||
|
||||
if($config['recaptcha_enabled'])
|
||||
if(config('recaptcha_enabled'))
|
||||
{
|
||||
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response']))
|
||||
{
|
||||
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$config['recaptcha_secret_key'].'&response='.$_POST['g-recaptcha-response']);
|
||||
$responseData = json_decode($verifyResponse);
|
||||
if(!$responseData->success)
|
||||
$errors['verification'] = "Please confirm that you're not a robot.";
|
||||
require LIBS . 'GoogleReCAPTCHA.php';
|
||||
if (!GoogleReCAPTCHA::verify('register')) {
|
||||
$errors['verification'] = GoogleReCAPTCHA::getErrorMessage();
|
||||
}
|
||||
else
|
||||
$errors['verification'] = "Please confirm that you're not a robot.";
|
||||
}
|
||||
|
||||
// password
|
||||
|
Reference in New Issue
Block a user