include key into user.set_password

This commit is contained in:
sirux88
2023-01-14 10:16:03 +01:00
committed by Daniel García
parent 2d8c8e18f7
commit cc91ac6cc0
4 changed files with 21 additions and 12 deletions

View File

@@ -644,7 +644,7 @@ async fn password_emergency_access(
let data: EmergencyAccessPasswordData = data.into_inner().data;
let new_master_password_hash = &data.NewMasterPasswordHash;
let key = data.Key;
//let key = &data.Key;
let requesting_user = headers.user;
let emergency_access = match EmergencyAccess::find_by_uuid(&emer_id, &mut conn).await {
@@ -662,8 +662,7 @@ async fn password_emergency_access(
};
// change grantor_user password
grantor_user.set_password(new_master_password_hash, true, None);
grantor_user.akey = key;
grantor_user.set_password(new_master_password_hash, Some(data.Key), true, None);
grantor_user.save(&mut conn).await?;
// Disable TwoFactor providers since they will otherwise block logins