fix: candidate password reset

This commit is contained in:
Sebastian Pravda 2022-12-23 21:03:32 +01:00
parent 9f35f6fa89
commit d3705a3ed0
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57

View file

@ -115,9 +115,13 @@ impl CandidateService {
new_password_plain.to_string()
).await?;
Self::delete_old_sessions(db, candidate.clone(), 0).await?;
Mutation::update_candidate_password_and_keys(db, candidate.clone(), new_password_hash, pubkey, encrypted_priv_key).await?;
let candidate = Mutation::update_candidate_password_and_keys(db,
candidate,
new_password_hash,
pubkey,
encrypted_priv_key
).await?;
// user might no have filled his details yet, but personal id number is filled from beginning
let personal_id_number = EncryptedString::from(candidate.personal_identification_number.clone())