This commit is contained in:
2025-11-11 15:18:06 +01:00
parent 7f371b2ab6
commit 1ee3d1cc5e
4 changed files with 27 additions and 11 deletions
+2 -3
View File
@@ -14,7 +14,7 @@ use tracing::{error, info};
use utoipa::{IntoParams, ToSchema};
use uuid::Uuid;
use crate::auth::{ensure_active_tenant, jwt::DownloadSubject, TenantScopedConn};
use crate::auth::{ensure_active_tenant_with_conn, jwt::DownloadSubject, TenantScopedConn};
use crate::documents::asset::{
asset_object_disposition, DocumentAssetDetailResponse, DocumentAssetResponse,
DocumentVersionDetailResponse, DocumentVersionResponse,
@@ -575,9 +575,8 @@ pub async fn download_with_token(
.verify_download_token(&token)
.map_err(|_| AppError::unauthorized())?;
ensure_active_tenant(&state, claims.tenant_id)?;
let mut conn = state.db_for_tenant(claims.tenant_id)?;
ensure_active_tenant_with_conn(&mut conn, claims.tenant_id)?;
let now = Utc::now().naive_utc();
let has_active_refresh: bool = select(exists(