You've already forked authentication-service
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:
@@ -40,7 +40,7 @@ pub use self::{
|
||||
AuthorizationCode, AuthorizationGrant, AuthorizationGrantStage, Client, DeviceCodeGrant,
|
||||
DeviceCodeGrantState, InvalidRedirectUriError, JwksOrJwksUri, Pkce, Session, SessionState,
|
||||
},
|
||||
site_config::SiteConfig,
|
||||
site_config::{CaptchaConfig, CaptchaService, SiteConfig},
|
||||
tokens::{
|
||||
AccessToken, AccessTokenState, RefreshToken, RefreshTokenState, TokenFormatError, TokenType,
|
||||
},
|
||||
|
@@ -15,6 +15,25 @@
|
||||
use chrono::Duration;
|
||||
use url::Url;
|
||||
|
||||
/// Which Captcha service is being used
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum CaptchaService {
|
||||
RecaptchaV2,
|
||||
}
|
||||
|
||||
/// Captcha configuration
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CaptchaConfig {
|
||||
/// Which Captcha service is being used
|
||||
pub service: CaptchaService,
|
||||
|
||||
/// The site key used by the instance
|
||||
pub site_key: String,
|
||||
|
||||
/// The secret key used by the instance
|
||||
pub secret_key: String,
|
||||
}
|
||||
|
||||
/// Random site configuration we want accessible in various places.
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -51,4 +70,7 @@ pub struct SiteConfig {
|
||||
|
||||
/// Whether users can change their password.
|
||||
pub password_change_allowed: bool,
|
||||
|
||||
/// Captcha configuration
|
||||
pub captcha: Option<CaptchaConfig>,
|
||||
}
|
||||
|
Reference in New Issue
Block a user