1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-06 06:02:40 +03:00

Render reCAPTCHA challenge on the registration form

This commit is contained in:
Quentin Gliech
2024-05-10 17:17:19 +02:00
parent c422c29a60
commit a3beeb2398
18 changed files with 342 additions and 19 deletions

View File

@@ -145,7 +145,8 @@ impl Options {
&config.matrix,
&config.experimental,
&config.passwords,
);
&config.captcha,
)?;
// Load and compile the templates
let templates =

View File

@@ -15,8 +15,8 @@
use clap::Parser;
use figment::Figment;
use mas_config::{
BrandingConfig, ConfigurationSection, ExperimentalConfig, MatrixConfig, PasswordsConfig,
TemplatesConfig,
BrandingConfig, CaptchaConfig, ConfigurationSection, ExperimentalConfig, MatrixConfig,
PasswordsConfig, TemplatesConfig,
};
use mas_storage::{Clock, SystemClock};
use rand::SeedableRng;
@@ -48,6 +48,7 @@ impl Options {
let matrix_config = MatrixConfig::extract(figment)?;
let experimental_config = ExperimentalConfig::extract(figment)?;
let password_config = PasswordsConfig::extract(figment)?;
let captcha_config = CaptchaConfig::extract(figment)?;
let clock = SystemClock::default();
// XXX: we should disallow SeedableRng::from_entropy
@@ -59,7 +60,8 @@ impl Options {
&matrix_config,
&experimental_config,
&password_config,
);
&captcha_config,
)?;
let templates =
templates_from_config(&template_config, &site_config, &url_builder).await?;
templates.check_render(clock.now(), &mut rng)?;

View File

@@ -52,7 +52,8 @@ impl Options {
&config.matrix,
&config.experimental,
&config.passwords,
);
&config.captcha,
)?;
// Load and compile the templates
let templates =