mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-10 08:06:42 +02:00
feat(recaptcha): Don't allow pubkey without associated privkey
This commit is contained in:
parent
ff805d8ae1
commit
14774fa153
1 changed files with 8 additions and 1 deletions
|
@ -180,11 +180,18 @@ pub fn check(config: &Config) -> Result {
|
|||
}
|
||||
}
|
||||
|
||||
if config.recaptcha_site_key.is_some() && config.recaptcha_private_site_key.is_none() {
|
||||
return Err!(Config(
|
||||
"recaptcha_private_site_key",
|
||||
"reCAPTCHA private site key is required when reCAPTCHA site key is set."
|
||||
));
|
||||
}
|
||||
|
||||
if config.allow_registration
|
||||
&& !config.yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse
|
||||
&& config.registration_token.is_none()
|
||||
&& config.registration_token_file.is_none()
|
||||
&& !(config.recaptcha_site_key.is_some() && config.recaptcha_private_site_key.is_some())
|
||||
&& config.recaptcha_site_key.is_none()
|
||||
{
|
||||
return Err!(Config(
|
||||
"registration_token",
|
||||
|
|
Loading…
Add table
Reference in a new issue