Refactor admin routes to use new AppError struct in responses
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user