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 <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-01-18 15:11:16 +01:00 committed by Thomas Lamprecht
parent f57ae48286
commit 9b6bddb24c

View 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,
}