use crate::{ApiResponse, error::ApiError}; use actix_web::{HttpResponse, Result, web}; use service::AppService; use service::auth::me::ContextMe; use session::Session; #[utoipa::path( post, path = "/api/auth/me", responses( (status = 200, description = "Current user info", body = ApiResponse), (status = 401, description = "Unauthorized", body = ApiResponse), (status = 500, description = "Internal server error", body = ApiResponse), (status = 404, description = "Not found", body = ApiResponse), ), tag = "Auth" )] pub async fn api_auth_me( service: web::Data, session: Session, ) -> Result { let me = service.auth_me(session).await?; Ok(ApiResponse::ok(me).to_response()) }