]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tfa: remove/empty description for recovery keys
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 18 Jan 2021 14:11:16 +0000 (15:11 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 18 Jan 2021 14:20:39 +0000 (15:20 +0100)
While the user chosen description is not allowed to be
empty, we do leave it empty for recovery keys, as a "dummy
description" makes little sense...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/config/tfa.rs

index aff1b3d8608124f89a2a5cf8fbaab1ee9bc56633..f957cd7549a5778da569c23380039fcec7948d6f 100644 (file)
@@ -343,6 +343,7 @@ pub struct TfaInfo {
     pub id: String,
 
     /// User chosen description for this entry.
+    #[serde(skip_serializing_if = "String::is_empty")]
     pub description: String,
 
     /// Creation time of this entry as unix epoch.
@@ -359,7 +360,7 @@ impl TfaInfo {
     pub(crate) fn recovery(created: i64) -> Self {
         Self {
             id: "recovery".to_string(),
-            description: "recovery keys".to_string(),
+            description: String::new(),
             enable: true,
             created,
         }