Update user modification time when changing password

Added modified_date update to OPAQUE password registration to ensure both password_modified_date and user modified_date are updated when passwords change. This provides better compatibility with LDAP clients that rely on modifyTimestamp for cache invalidation.

Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-27 19:00:49 +00:00
parent 7e64e061d3
commit edf22afda0
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -291,10 +291,11 @@ pub fn make_ldap_subschema_entry(schema: PublicSchema) -> LdapOp {
}
pub(crate) fn is_root_dse_request(request: &LdapSearchRequest) -> bool {
if request.base.is_empty()
if request.base.is_empty()
&& request.scope == LdapSearchScope::Base
&& let LdapFilter::Present(attribute) = &request.filter
&& attribute.eq_ignore_ascii_case("objectclass") {
&& attribute.eq_ignore_ascii_case("objectclass")
{
return true;
}
false
@@ -202,6 +202,7 @@ impl OpaqueHandler for SqlOpaqueHandler {
user_id: ActiveValue::Set(username.clone()),
password_hash: ActiveValue::Set(Some(password_file.serialize())),
password_modified_date: ActiveValue::Set(now),
modified_date: ActiveValue::Set(now),
..Default::default()
};
user_update.update(&self.sql_pool).await?;