Refactor users management
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
* Shard `src/data/user.rs` into two different files * One for user data structure (same file) * One for user manipulation (new file: `user_file_entity.rs`) * Isolate password hashing and verification
This commit is contained in:
@ -103,7 +103,14 @@ pub async fn change_password_route(
|
||||
);
|
||||
} else if let Some(req) = req {
|
||||
// Invalid password
|
||||
if !user.verify_password(&req.old_pass) {
|
||||
if !users
|
||||
.send(users_actor::VerifyUserPasswordRequest(
|
||||
user.uid.clone(),
|
||||
req.old_pass.clone(),
|
||||
))
|
||||
.await
|
||||
.unwrap()
|
||||
{
|
||||
danger = Some("Old password is invalid!".to_string());
|
||||
bruteforce
|
||||
.send(bruteforce_actor::RecordFailedAttempt {
|
||||
|
Reference in New Issue
Block a user