mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-24 11:23:38 +03:00
2fa email fallback need a verified email (#7770)
Co-authored-by: Timshel <timshel@users.noreply.github.com> Co-authored-by: Mathijs van Veluw <black.dex@gmail.com>
This commit is contained in:
3 files changed
+12
-7
No files matched your search
@@ -257,6 +257,10 @@ impl User {
|
||||
|
||||
/// Database methods
|
||||
impl User {
|
||||
pub fn verified(&self) -> bool {
|
||||
!CONFIG.mail_enabled() || self.verified_at.is_some()
|
||||
}
|
||||
|
||||
pub async fn to_json(&self, conn: &DbConn) -> Value {
|
||||
let mut orgs_json = Vec::new();
|
||||
for c in Membership::find_confirmed_by_user(&self.uuid, conn).await {
|
||||
@@ -299,7 +303,7 @@ impl User {
|
||||
"id": self.uuid,
|
||||
"name": self.name,
|
||||
"email": self.email,
|
||||
"emailVerified": !CONFIG.mail_enabled() || self.verified_at.is_some(),
|
||||
"emailVerified": self.verified(),
|
||||
"premium": true,
|
||||
"premiumFromOrganization": false,
|
||||
"culture": "en-US",
|
||||
|
||||
Reference in new issue
Block a user