Nit picking a little.
This commit is contained in:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user