set_master_pass now asks for the master password twice
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use crate::prelude::*;
|
||||
use cryptography::hashing::HashedBytes;
|
||||
use log::error;
|
||||
use tokio::task::spawn_blocking;
|
||||
|
||||
@ -14,8 +15,9 @@ async fn check_master_pass(
|
||||
|
||||
let is_valid = match model {
|
||||
Some(model) => {
|
||||
let hash: HashedBytes<_, _> = model.into();
|
||||
let master_pass = master_pass.to_owned();
|
||||
spawn_blocking(move || model.verify(&master_pass)).await?
|
||||
spawn_blocking(move || hash.verify(master_pass.as_bytes())).await?
|
||||
}
|
||||
None => {
|
||||
error!("User was put into the GetMasterPass state with no master password set");
|
||||
|
Reference in New Issue
Block a user