chore: Merge branch 'nex/feat/registration-messages'

This commit is contained in:
timedout committed 2026-08-12 14:25:15 +01:00
commit 08d3d8445f
3 files changed
+29 -1

No files matched your search

+1
View File
@@ -0,0 +1 @@
Re-introduced admin room registration alerts that were accidentally removed in the OAuth2 update.
+20
View File
@@ -138,6 +138,26 @@ pub(crate) async fn register_route(
};
debug_info!(%user_id, ?device, "New account created via legacy registration");
// Only log if the user wasn't registered via an appservice.
if body.identity.is_none() {
let notice = if device.is_some()
&& let Some(device_name) = body.initial_device_display_name.as_ref()
{
format!(
"New user \"{user_id}\" registered on this server from IP {client} and device \
display name \"{device_name}\" via legacy registration",
)
} else {
format!(
"New user \"{user_id}\" registered on this server from IP {client} via legacy \
registration."
)
};
info!("{notice}");
if services.server.config.admin_room_notices {
services.admin.notice(&notice).await;
}
}
Ok(assign!(register::v3::Response::new(user_id), {
access_token: token.map(DeviceToken::into_token),
+8 -1
View File
@@ -7,7 +7,7 @@ use axum::{
routing::{get, on},
};
use conduwuit_api::client_ip::ClientIp;
use conduwuit_core::{config::TermsDocument, warn};
use conduwuit_core::{config::TermsDocument, info, warn};
use conduwuit_service::{
mailer::messages,
registration_tokens::ValidToken,
@@ -536,6 +536,13 @@ async fn complete_registration(
.mark_token_as_used(registration_token);
}
let notice = format!("New user \"{user_id}\" registered on this server from IP {client}.");
info!("{notice}");
if services.server.config.admin_room_notices {
services.admin.notice(&notice).await;
}
let user_session = UserSession { user_id, last_login: SystemTime::now() };
session_store