Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-09-11 19:19:39 +02:00
Fix UserOrg status during LDAP Import
When a user does not have an account yet and SMTP was disabled it would set the UserOrg status still to Accepted, though that would make it possible to verify the user by the Org Admin's. This would fail, since the user didn't actually crated his account, and therefor no PublicKey existed. This PR fixes this behaviour by checking if the password is empty and if so, puts the user to an `Invited` state instead of `Accepted`. Fixes #3737
Dieser Commit ist enthalten in:
Ursprung
3dbfc484a5
Commit
d892880dd2
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
|
@ -85,7 +85,7 @@ async fn ldap_import(data: JsonUpcase<OrgImportData>, token: PublicToken, mut co
|
||||||
new_user
|
new_user
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let user_org_status = if CONFIG.mail_enabled() {
|
let user_org_status = if CONFIG.mail_enabled() || user.password_hash.is_empty() {
|
||||||
UserOrgStatus::Invited as i32
|
UserOrgStatus::Invited as i32
|
||||||
} else {
|
} else {
|
||||||
UserOrgStatus::Accepted as i32 // Automatically mark user as accepted if no email invites
|
UserOrgStatus::Accepted as i32 // Automatically mark user as accepted if no email invites
|
||||||
|
|
Laden …
In neuem Issue referenzieren