feat: record daily login tracking on auth success
This commit is contained in:
@@ -4,7 +4,7 @@ use axum::{
|
||||
http::{HeaderMap, StatusCode},
|
||||
response::IntoResponse,
|
||||
};
|
||||
use module_auth::{PasswordEntryError, PasswordEntryInput};
|
||||
use module_auth::{AuthLoginMethod, PasswordEntryError, PasswordEntryInput};
|
||||
use serde_json::json;
|
||||
use shared_contracts::auth::{PasswordEntryRequest, PasswordEntryResponse};
|
||||
|
||||
@@ -12,7 +12,8 @@ use crate::{
|
||||
api_response::json_success_body,
|
||||
auth_payload::map_auth_user_payload,
|
||||
auth_session::{
|
||||
attach_set_cookie_header, build_refresh_session_cookie_header, create_password_auth_session,
|
||||
attach_set_cookie_header, build_refresh_session_cookie_header,
|
||||
create_password_auth_session, record_daily_login_tracking_event_after_auth_success,
|
||||
},
|
||||
http_error::AppError,
|
||||
request_context::RequestContext,
|
||||
@@ -49,6 +50,13 @@ pub async fn password_entry(
|
||||
}
|
||||
let session_client = resolve_session_client_context(&headers);
|
||||
let signed_session = create_password_auth_session(&state, &result.user, &session_client)?;
|
||||
record_daily_login_tracking_event_after_auth_success(
|
||||
&state,
|
||||
&request_context,
|
||||
&result.user.id,
|
||||
AuthLoginMethod::Password,
|
||||
)
|
||||
.await;
|
||||
state
|
||||
.sync_auth_store_snapshot_to_spacetime()
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user