use axum::{ Json, extract::Path, http::HeaderMap, response::{IntoResponse, Response}, }; use uuid::Uuid; use crate::{ api::CompositeError, users::{ User, auth::{UserAuthRequired, UserAuthenticate}, sessions::Session, }, }; pub async fn get_by_id( Path(id): Path, headers: HeaderMap, ) -> Result { User::authenticate(&headers)?.required()?; Ok(Json(Session::get_by_id(id)?).into_response()) }