Compare commits

..

1 Commits

Author SHA1 Message Date
Ginger 18b365561b docs: Clarify documentation for require_email_for_registration 2026-05-20 11:35:01 -04:00
3 changed files with 16 additions and 23 deletions
+6 -3
View File
@@ -1959,8 +1959,10 @@
#
#sender =
# Whether to require that users provide an email address when they
# register.
# Whether to allow public registration with an email address.
#
# Note that, if this option is enabled, anyone will be able to register an
# account with just an email address.
#
# If either this option or `require_email_for_token_registration` are set,
# users will not be allowed to remove their email address.
@@ -1968,6 +1970,7 @@
#require_email_for_registration = false
# Whether to require that users who register with a registration token
# provide an email address.
# provide an email address. This option is independent of
# `require_email_for_registration`.
#
#require_email_for_token_registration = false
+4 -17
View File
@@ -9,7 +9,6 @@
AccessToken, AccessTokenOptional, AppserviceToken, AppserviceTokenOptional,
AuthScheme, NoAccessToken, NoAuthentication,
},
client,
federation::authentication::ServerSignatures,
},
};
@@ -117,9 +116,10 @@ async fn verify<B: AsRef<[u8]> + Sync>(
.await
.is_ok_and(std::convert::identity)
{
if !(route == TypeId::of::<client::session::logout::v3::Request>()
|| route == TypeId::of::<client::session::logout_all::v3::Request>())
{
if !(route == TypeId::of::<ruma::api::client::session::logout::v3::Request>()
|| route
== TypeId::of::<ruma::api::client::session::logout_all::v3::Request>(
)) {
return Err!(Request(Unauthorized("Your account is locked.")));
}
}
@@ -258,19 +258,6 @@ async fn verify<B: AsRef<[u8]> + Sync>(
err!(Request(Unauthorized(warn!("Failed to extract authorization: {}", err))))
})?;
// Check special access restrictions
if (route == TypeId::of::<client::profile::get_avatar_url::v3::Request>()
|| route == TypeId::of::<client::profile::get_display_name::v3::Request>()
|| route == TypeId::of::<client::profile::get_profile_field::v3::Request>()
|| route == TypeId::of::<client::profile::get_profile::v3::Request>())
&& services.config.require_auth_for_profile_requests
&& token.is_none()
{
return Err!(Request(Unauthorized(
"This server requires authentication to access user profiles."
)));
}
<AccessTokenOptional as CheckAuth>::verify(services, token, request, query, route).await
}
}
+6 -3
View File
@@ -2318,8 +2318,10 @@ pub struct SmtpConfig {
/// - `address@domain.org` to not use a name
pub sender: Mailbox,
/// Whether to require that users provide an email address when they
/// register.
/// Whether to allow public registration with an email address.
///
/// Note that, if this option is enabled, anyone will be able to register an
/// account with just an email address.
///
/// If either this option or `require_email_for_token_registration` are set,
/// users will not be allowed to remove their email address.
@@ -2329,7 +2331,8 @@ pub struct SmtpConfig {
pub require_email_for_registration: bool,
/// Whether to require that users who register with a registration token
/// provide an email address.
/// provide an email address. This option is independent of
/// `require_email_for_registration`.
///
/// default: false
#[serde(default)]