mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-09-01 20:18:31 +00:00
fix: Re-introduce registration alerts
This commit is contained in:
@@ -141,6 +141,23 @@ 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 via legacy registration.")
|
||||
};
|
||||
info!("{notice}");
|
||||
if services.server.config.admin_room_notices {
|
||||
services.admin.notice(¬ice).await;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(assign!(register::v3::Response::new(user_id), {
|
||||
access_token: token.map(DeviceToken::into_token),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
response::{Redirect, Response},
|
||||
routing::{get, on},
|
||||
};
|
||||
use conduwuit_core::{config::TermsDocument, warn};
|
||||
use conduwuit_core::{config::TermsDocument, info, warn};
|
||||
use conduwuit_service::{
|
||||
mailer::messages,
|
||||
registration_tokens::ValidToken,
|
||||
@@ -523,6 +523,13 @@ async fn complete_registration(
|
||||
.mark_token_as_used(registration_token);
|
||||
}
|
||||
|
||||
let notice = format!("New user \"{user_id}\" registered on this server.");
|
||||
|
||||
info!("{notice}");
|
||||
if services.server.config.admin_room_notices {
|
||||
services.admin.notice(¬ice).await;
|
||||
}
|
||||
|
||||
let user_session = UserSession { user_id, last_login: SystemTime::now() };
|
||||
|
||||
session_store
|
||||
|
||||
Reference in New Issue
Block a user