Nit picking a little.

This commit is contained in:
2026-10-12 12:01:26 +02:00
parent b40d686ef9
commit c89b76043b
6 changed files with 63 additions and 83 deletions
+2 -2
View File
@@ -1,4 +1,5 @@
use axum::{extract::State, http::StatusCode};
use chrono::Utc;
use serde::Deserialize;
use sqlx::PgPool;
use uuid::Uuid;
@@ -92,11 +93,10 @@ async fn upsert_user_app_secret(
return Err(AppError::NotFound);
}
let now = chrono::Utc::now();
let generated_secret = generate_secret().map_err(|_| AppError::Unknown)?;
let hashed_secret = hash_secret(&generated_secret);
let secret = request.into_domain(secret_id, app_id, hashed_secret, now)?;
let secret = request.into_domain(secret_id, app_id, hashed_secret, Utc::now())?;
let upserted = repository::user_app_secrets::upsert(&pool, user_id, secret)
.await?
.ok_or(AppError::NotFound)?;