mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-12 19:56:48 +00:00
chore: Merge branch 'nex/feat/registration-messages'
This commit is contained in:
3 files changed
+29
-1
No files matched your search
@@ -0,0 +1 @@
|
||||
Re-introduced admin room registration alerts that were accidentally removed in the OAuth2 update.
|
||||
@@ -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(¬ice).await;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(assign!(register::v3::Response::new(user_id), {
|
||||
access_token: token.map(DeviceToken::into_token),
|
||||
|
||||
@@ -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(¬ice).await;
|
||||
}
|
||||
|
||||
let user_session = UserSession { user_id, last_login: SystemTime::now() };
|
||||
|
||||
session_store
|
||||
|
||||
Reference in new issue
Block a user