Daniel
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
11 additions and
3 deletions
-
src/api/core/two_factor/mod.rs
|
|
@ -269,10 +269,18 @@ pub async fn send_incomplete_2fa_notifications(pool: DbPool) { |
|
|
|
"User {} did not complete a 2FA login within the configured time limit. IP: {}", |
|
|
|
user.email, login.ip_address |
|
|
|
); |
|
|
|
mail::send_incomplete_2fa_login(&user.email, &login.ip_address, &login.login_time, &login.device_name) |
|
|
|
match mail::send_incomplete_2fa_login(&user.email, &login.ip_address, &login.login_time, &login.device_name) |
|
|
|
.await |
|
|
|
.expect("Error sending incomplete 2FA email"); |
|
|
|
login.delete(&mut conn).await.expect("Error deleting incomplete 2FA record"); |
|
|
|
{ |
|
|
|
Ok(_) => { |
|
|
|
if let Err(e) = login.delete(&mut conn).await { |
|
|
|
error!("Error deleting incomplete 2FA record: {e:#?}"); |
|
|
|
} |
|
|
|
} |
|
|
|
Err(e) => { |
|
|
|
error!("Error sending incomplete 2FA email: {e:#?}"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|