diff options
| author | gennyble <gen@nyble.dev> | 2026-09-25 04:02:02 -0500 |
|---|---|---|
| committer | gennyble <gen@nyble.dev> | 2026-09-25 04:02:02 -0500 |
| commit | 2d79f59970985fa459de3cd0729696558c81a92e (patch) | |
| tree | b14743946730d4176fdc7e147b5db215b1a97510 | |
| parent | ba592de54cd3dce52eb2096dabbe748107f5db2b (diff) | |
remove /auth_test route
| -rw-r--r-- | splorm/HORICULTURE.md | 1 | ||||
| -rw-r--r-- | splorm/src/main.rs | 14 |
2 files changed, 2 insertions, 13 deletions
diff --git a/splorm/HORICULTURE.md b/splorm/HORICULTURE.md index 1a44a78..e3bb964 100644 --- a/splorm/HORICULTURE.md +++ b/splorm/HORICULTURE.md @@ -9,6 +9,7 @@ - [] Document available template patterns and variables - [] Docuemnt frontmatter variables - [] Wikarden CRUD with authentication + - [x] Authentication - [] Create posts - [] Read posts - [] Update (edit) posts diff --git a/splorm/src/main.rs b/splorm/src/main.rs index f4cff19..5aec6a4 100644 --- a/splorm/src/main.rs +++ b/splorm/src/main.rs @@ -1,13 +1,9 @@ -use std::sync::Arc; - -use axum::{Extension, Router, body::Body, middleware::from_fn, response::Response, routing::get}; -use somethings::auth::Session; +use axum::{Extension, Router, middleware::from_fn, routing::get}; use tokio::{net::TcpListener, runtime::Builder}; use crate::{ config::{CommandLine, Config}, connector::GathererThread, - extractor::Wrap, state::{ConnectorsState, SplormState}, }; @@ -50,7 +46,6 @@ async fn async_main(conf: Config, state: SplormState) { // Setup the routing let bare_routes = Router::new() .route("/", get(handler::index)) - .route("/auth_test", get(authtest)) .nest("/api", handler::api::routes()) .route("/{*path}", get(handler::static_path)); @@ -67,10 +62,3 @@ async fn async_main(conf: Config, state: SplormState) { let listener = TcpListener::bind(addr).await.unwrap(); axum::serve(listener, routes).await.unwrap(); } - -async fn authtest(Wrap(session): Wrap<Session>) -> Result<Response, RuntimeError> { - Response::builder() - .status(200) - .body(Body::new(format!("welcome {}", session.user().name()))) - .map_err(|_| RuntimeError::Unknown) -} |
