|
|
@ -487,8 +487,7 @@ async fn post_set_password(data: Json<SetPasswordData>, headers: Headers, conn: |
|
|
Membership::accept_user_invitations(&user.uuid, &conn).await?; |
|
|
Membership::accept_user_invitations(&user.uuid, &conn).await?; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
log_user_event(EventType::UserChangedPassword as i32, &user.uuid, headers.device.atype, &headers.ip.ip, &conn) |
|
|
log_user_event(EventType::UserChangedPassword, &user.uuid, headers.device.atype, &headers.ip.ip, &conn).await; |
|
|
.await; |
|
|
|
|
|
|
|
|
|
|
|
user.save(&conn).await?; |
|
|
user.save(&conn).await?; |
|
|
|
|
|
|
|
|
@ -613,8 +612,7 @@ async fn post_password(data: Json<ChangePassData>, headers: Headers, conn: DbCon |
|
|
err!("Invalid password") |
|
|
err!("Invalid password") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
log_user_event(EventType::UserChangedPassword as i32, &user.uuid, headers.device.atype, &headers.ip.ip, &conn) |
|
|
log_user_event(EventType::UserChangedPassword, &user.uuid, headers.device.atype, &headers.ip.ip, &conn).await; |
|
|
.await; |
|
|
|
|
|
|
|
|
|
|
|
let (new_master_password_hash, new_key) = |
|
|
let (new_master_password_hash, new_key) = |
|
|
if let (Some(unlock_data), Some(authentication_data)) = (data.unlock_data, data.authentication_data) { |
|
|
if let (Some(unlock_data), Some(authentication_data)) = (data.unlock_data, data.authentication_data) { |
|
|
@ -1620,7 +1618,7 @@ async fn post_auth_request( |
|
|
nt.send_auth_request(&user.uuid, &auth_request.uuid, &device, &conn).await; |
|
|
nt.send_auth_request(&user.uuid, &auth_request.uuid, &device, &conn).await; |
|
|
|
|
|
|
|
|
log_user_event( |
|
|
log_user_event( |
|
|
EventType::UserRequestedDeviceApproval as i32, |
|
|
EventType::UserRequestedDeviceApproval, |
|
|
&user.uuid, |
|
|
&user.uuid, |
|
|
client_headers.device_type, |
|
|
client_headers.device_type, |
|
|
&client_headers.ip.ip, |
|
|
&client_headers.ip.ip, |
|
|
@ -1714,7 +1712,7 @@ async fn put_auth_request( |
|
|
nt.send_auth_response(&auth_request.user_uuid, &auth_request.uuid, &headers.device, &conn).await; |
|
|
nt.send_auth_response(&auth_request.user_uuid, &auth_request.uuid, &headers.device, &conn).await; |
|
|
|
|
|
|
|
|
log_user_event( |
|
|
log_user_event( |
|
|
EventType::OrganizationUserApprovedAuthRequest as i32, |
|
|
EventType::OrganizationUserApprovedAuthRequest, |
|
|
&headers.user.uuid, |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
@ -1725,7 +1723,7 @@ async fn put_auth_request( |
|
|
// If denied, there's no reason to keep the request
|
|
|
// If denied, there's no reason to keep the request
|
|
|
auth_request.delete(&conn).await?; |
|
|
auth_request.delete(&conn).await?; |
|
|
log_user_event( |
|
|
log_user_event( |
|
|
EventType::OrganizationUserRejectedAuthRequest as i32, |
|
|
EventType::OrganizationUserRejectedAuthRequest, |
|
|
&headers.user.uuid, |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
|