Refactor admin routes to use new AppError struct in responses

This commit is contained in:
Alphonse Paix
2025-09-20 01:08:05 +02:00
parent 2b9cf979e8
commit 7971095227
7 changed files with 86 additions and 75 deletions

View File

@@ -1,5 +1,7 @@
use crate::{
routes::AdminError, session_state::TypedSession, telemetry::spawn_blocking_with_tracing,
routes::{AdminError, AppError},
session_state::TypedSession,
telemetry::spawn_blocking_with_tracing,
};
use anyhow::Context;
use argon2::{
@@ -135,7 +137,7 @@ pub async fn require_auth(
session: TypedSession,
mut request: Request,
next: Next,
) -> Result<Response, AdminError> {
) -> Result<Response, AppError> {
let user_id = session
.get_user_id()
.await