Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-16 04:12:53 +01:00
Add MFA icon to org member overview
The Organization member overview supports showing an icon if the user has MFA enabled or not. This PR adds this feature. This is very useful if you want to enable force mfa for example.
Dieser Commit ist enthalten in:
Ursprung
e0e95e95e4
Commit
aaffb2e007
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
|
@ -2,7 +2,7 @@ use num_traits::FromPrimitive;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
use super::{CollectionUser, GroupUser, OrgPolicy, OrgPolicyType, User};
|
use super::{CollectionUser, GroupUser, OrgPolicy, OrgPolicyType, TwoFactor, User};
|
||||||
use crate::CONFIG;
|
use crate::CONFIG;
|
||||||
|
|
||||||
db_object! {
|
db_object! {
|
||||||
|
@ -365,6 +365,8 @@ impl UserOrganization {
|
||||||
self.status
|
self.status
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let twofactor_enabled = !TwoFactor::find_by_user(&user.uuid, conn).await.is_empty();
|
||||||
|
|
||||||
json!({
|
json!({
|
||||||
"Id": self.uuid,
|
"Id": self.uuid,
|
||||||
"UserId": self.user_uuid,
|
"UserId": self.user_uuid,
|
||||||
|
@ -374,6 +376,7 @@ impl UserOrganization {
|
||||||
"Status": status,
|
"Status": status,
|
||||||
"Type": self.atype,
|
"Type": self.atype,
|
||||||
"AccessAll": self.access_all,
|
"AccessAll": self.access_all,
|
||||||
|
"TwoFactorEnabled": twofactor_enabled,
|
||||||
|
|
||||||
"Object": "organizationUserUserDetails",
|
"Object": "organizationUserUserDetails",
|
||||||
})
|
})
|
||||||
|
|
Laden …
In neuem Issue referenzieren