Removing existing secrets before creating a new one
This commit is contained in:
parent
6bb87944af
commit
96c94f1797
1 changed files with 9 additions and 1 deletions
10
src/app.rs
10
src/app.rs
|
@ -147,7 +147,15 @@ impl AppOp {
|
|||
let ss = SecretService::new(EncryptionType::Dh)?;
|
||||
let collection = ss.get_default_collection()?;
|
||||
|
||||
//create new item
|
||||
// deleting previous items
|
||||
let allpass = collection.get_all_items()?;
|
||||
let passwds = allpass.iter()
|
||||
.filter(|x| x.get_label().unwrap_or(String::from("")) == "guillotine");
|
||||
for p in passwds {
|
||||
p.delete()?;
|
||||
}
|
||||
|
||||
// create new item
|
||||
collection.create_item(
|
||||
"guillotine", // label
|
||||
vec![
|
||||
|
|
Loading…
Reference in a new issue