Updated cryptography functions to be in-place
This commit is contained in:
@@ -20,9 +20,14 @@ async fn get_master_pass(
|
||||
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
|
||||
|
||||
let account = spawn_blocking(move || {
|
||||
account::ActiveModel::from_unencrypted(user_id, name, &login, &password, &master_pass)
|
||||
DecryptedAccount {
|
||||
name,
|
||||
login,
|
||||
password,
|
||||
}
|
||||
.into_account(user_id, &master_pass)
|
||||
})
|
||||
.await??;
|
||||
.await?;
|
||||
account.insert(&db).await?;
|
||||
|
||||
ids.alter_message(&bot, "Success", deletion_markup(), None)
|
||||
|
@@ -17,7 +17,7 @@ async fn encrypt_account(
|
||||
) {
|
||||
let name = account.name.clone();
|
||||
match spawn_blocking(move || account.into_account(user_id, &master_pass)).await {
|
||||
Ok(Ok(account)) => match account.insert(db).await {
|
||||
Ok(account) => match account.insert(db).await {
|
||||
Ok(_) => (),
|
||||
Err(_) => failed.lock().push(name),
|
||||
},
|
||||
|
Reference in New Issue
Block a user