mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-07-30 07:39:09 +00:00
also correctly log auth requests
This commit is contained in:
parent
32d47faa3b
commit
3d6f9cf3d6
1 changed files with 26 additions and 0 deletions
|
@ -1206,6 +1206,15 @@ async fn post_auth_request(
|
||||||
|
|
||||||
nt.send_auth_request(&user.uuid, &auth_request.uuid, &data.device_identifier, &mut conn).await;
|
nt.send_auth_request(&user.uuid, &auth_request.uuid, &data.device_identifier, &mut conn).await;
|
||||||
|
|
||||||
|
log_user_event(
|
||||||
|
EventType::UserRequestedDeviceApproval as i32,
|
||||||
|
&user.uuid,
|
||||||
|
client_headers.device_type,
|
||||||
|
&client_headers.ip.ip,
|
||||||
|
&mut conn,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
Ok(Json(json!({
|
Ok(Json(json!({
|
||||||
"id": auth_request.uuid,
|
"id": auth_request.uuid,
|
||||||
"publicKey": auth_request.public_key,
|
"publicKey": auth_request.public_key,
|
||||||
|
@ -1287,9 +1296,26 @@ async fn put_auth_request(
|
||||||
|
|
||||||
ant.send_auth_response(&auth_request.user_uuid, &auth_request.uuid).await;
|
ant.send_auth_response(&auth_request.user_uuid, &auth_request.uuid).await;
|
||||||
nt.send_auth_response(&auth_request.user_uuid, &auth_request.uuid, &data.device_identifier, &mut conn).await;
|
nt.send_auth_response(&auth_request.user_uuid, &auth_request.uuid, &data.device_identifier, &mut conn).await;
|
||||||
|
|
||||||
|
log_user_event(
|
||||||
|
EventType::OrganizationUserApprovedAuthRequest as i32,
|
||||||
|
&headers.user.uuid,
|
||||||
|
headers.device.atype,
|
||||||
|
&headers.ip.ip,
|
||||||
|
&mut conn,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
} else {
|
} else {
|
||||||
// If denied, there's no reason to keep the request
|
// If denied, there's no reason to keep the request
|
||||||
auth_request.delete(&mut conn).await?;
|
auth_request.delete(&mut conn).await?;
|
||||||
|
log_user_event(
|
||||||
|
EventType::OrganizationUserRejectedAuthRequest as i32,
|
||||||
|
&headers.user.uuid,
|
||||||
|
headers.device.atype,
|
||||||
|
&headers.ip.ip,
|
||||||
|
&mut conn,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Json(json!({
|
Ok(Json(json!({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue