mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
Create ldap user only after successful login attempt.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
f2a45d4408
commit
f9b7c1e0b9
1 file changed
+7
-6
@@ -110,6 +110,12 @@ async fn ldap_login(
|
||||
},
|
||||
};
|
||||
|
||||
let user_id = services
|
||||
.users
|
||||
.auth_ldap(&user_dn, password)
|
||||
.await
|
||||
.map(|()| lowercased_user_id.to_owned())?;
|
||||
|
||||
// LDAP users are automatically created on first login attempt. This is a very
|
||||
// common feature that can be seen on many services using a LDAP provider for
|
||||
// their users (synapse, Nextcloud, Jellyfin, ...).
|
||||
@@ -124,12 +130,7 @@ async fn ldap_login(
|
||||
.await?;
|
||||
}
|
||||
|
||||
debug!("{user_dn:?} {password:?}");
|
||||
services
|
||||
.users
|
||||
.auth_ldap(&user_dn, password)
|
||||
.await
|
||||
.map(|()| lowercased_user_id.to_owned())
|
||||
Ok(user_id)
|
||||
}
|
||||
|
||||
/// # `POST /_matrix/client/v3/login`
|
||||
|
||||
Reference in new issue
Block a user