aryehraber / statamic-captcha

Statamic Addon that protects your Statamic forms using a Captcha service.
MIT License
11 stars 8 forks source link

Config Can't use secret key from .env #33

Closed enespolat24 closed 2 years ago

enespolat24 commented 2 years ago

Hi, we encountered an issue. It seems config file can't use the secret key we define in the .env. Can you check it ?

aryehraber commented 2 years ago

Hi @enespolat24, could you please supply some more details:

Thanks!

enespolat24 commented 2 years ago

statamic 3.2.32 captcha v2

this is my config file

<?php

return [
    'service' => 'Recaptcha', // options: Recaptcha / Hcaptcha
    'sitekey' => env('CAPTCHA_SITEKEY', ''),
    'secret' => env('CAPTCHA_SECRET', ''),
    'collections' => [],
    'forms' => ['contact'],
    'user_login' => false,
    'user_registration' => false,
    'disclaimer' => '',
    'invisible' => true,
    'hide_badge' => false,
    'enable_api_routes' => false,
];

this is my .env

CAPTCHA_SITEKEY=blablabalbalb
CAPTCHA_SECRETKEY=blablalbalbalbal
aryehraber commented 2 years ago

Thanks for the quick reply!

I think I see the issue, the .env key CAPTCHA_SECRETKEY should be CAPTCHA_SECRET. Does that solve the issue?

enespolat24 commented 2 years ago

Yeah that fixed my issue. It would be great to add this in the documentation.because i didn't know it was CAPTCHA_SECRET. Thank you so much !! 🚀

aryehraber commented 2 years ago

The key CAPTCHA_SECRET is right there in the config file you shared, so don't think it's needed in the docs.

Glad everything is working now 👍