Sfoglia il codice sorgente

fix: captcha return value

Cat 3 anni fa
parent
commit
1089c0eddf
1 ha cambiato i file con 7 aggiunte e 9 eliminazioni
  1. 7 9
      src/Services/Captcha.php

+ 7 - 9
src/Services/Captcha.php

@@ -10,22 +10,20 @@ final class Captcha
 {
     public static function generate(): array
     {
-        $geetest = null;
-        $turnstile = null;
-
         switch (Setting::obtain('captcha_provider')) {
             case 'turnstile':
-                $turnstile = Setting::obtain('turnstile_sitekey');
+                return [
+                    'turnstile_sitekey' => Setting::obtain('turnstile_sitekey'),
+                ];
                 break;
             case 'geetest':
-                $geetest = Setting::obtain('geetest_id');
+                return [
+                    'geetest_id' => Setting::obtain('geetest_id'),
+                ];
                 break;
         }
 
-        return [
-            'geetest' => $geetest,
-            'turnstile' => $turnstile,
-        ];
+        return [];
     }
 
     /**