From 9b6bddb24ce1097e93f4293f5c11f5040c16da3d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 18 Jan 2021 15:11:16 +0100 Subject: [PATCH] tfa: remove/empty description for recovery keys 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 --- src/config/tfa.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/tfa.rs b/src/config/tfa.rs index aff1b3d8..f957cd75 100644 --- a/src/config/tfa.rs +++ b/src/config/tfa.rs @@ -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, }