diff --git a/.env.example b/.env.example index 116b25c..51aefb3 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ DB_HOST=localhost:3306 # 数据库地址 DB_NAME=yii2basic # 数据库名 DB_USERNAME=root # 数据库用户名 DB_PASSWORD= # 数据库密码 -VERIFY_PROVIDER= # 验证服务提供商[reCAPTCHA,hCaptcha,Turnstile] +VERIFY_PROVIDER= # 验证服务提供商[reCAPTCHA,hCaptcha,Turnstile,None] RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # Google Recaptcha Site Key # Test Site Key RECAPTCHA_SECRET=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe # Google Recaptcha Secret # Test Key HCAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001 # hCaptcha Site Key # Test Site Key diff --git a/controllers/UserController.php b/controllers/UserController.php index 7c07f0a..da4e013 100644 --- a/controllers/UserController.php +++ b/controllers/UserController.php @@ -168,7 +168,7 @@ class UserController extends Controller $isCaptchaValid = $this->validateTurnstile($captchaResponse); } - if ($captchaResponse !== null && $isCaptchaValid) { + if (($captchaResponse !== null && $isCaptchaValid) || ($verifyProvider === 'None')) { if ($model->login()) { return $this->goBack(); } else { @@ -287,7 +287,7 @@ class UserController extends Controller $isCaptchaValid = $this->validateTurnstile($captchaResponse); } - if ($captchaResponse !== null && $isCaptchaValid) { + if (($captchaResponse !== null && $isCaptchaValid) || ($verifyProvider === 'None')) { $raw_password = $model->password; $model->password = Yii::$app->security->generatePasswordHash($raw_password); $model->auth_key = Yii::$app->security->generateRandomString();