fix and enable collapsible_if lint

Signed-off-by: June Strawberry <june@vern.cc>
This commit is contained in:
June Strawberry
2026-01-15 17:39:33 -05:00
parent fb102f0e0a
commit 04e66a03d3
54 changed files with 453 additions and 504 deletions

View File

@@ -117,16 +117,16 @@ pub async fn try_auth(
#[cfg(feature = "ldap")]
if !password_verified && self.services.server.config.ldap.enable {
// Search for user in LDAP to get their DN
if let Ok(dns) = self.services.users.search_ldap(&user_id).await {
if let Some((user_dn, _is_admin)) = dns.first() {
// Try to authenticate with LDAP
password_verified = self
.services
.users
.auth_ldap(user_dn, password)
.await
.is_ok();
}
if let Ok(dns) = self.services.users.search_ldap(&user_id).await
&& let Some((user_dn, _is_admin)) = dns.first()
{
// Try to authenticate with LDAP
password_verified = self
.services
.users
.auth_ldap(user_dn, password)
.await
.is_ok();
}
}