diff options
author | mia <mia@mia.jetzt> | 2024-05-03 18:25:03 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-05-03 18:25:03 -0700 |
commit | c630a3d95fcba117eeeeb03a0c656ef26bea3072 (patch) | |
tree | 6e10801f20716bcd45d3bbc113a02908f05129a2 /src/server/panel.rs | |
parent | cb74c3346428d5e352b66d1f7982f77e0e8b8621 (diff) | |
download | dissociate-0.3.0.tar.gz dissociate-0.3.0.zip |
refactor scope access endpoints v0.3.0
Diffstat (limited to 'src/server/panel.rs')
-rw-r--r-- | src/server/panel.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/server/panel.rs b/src/server/panel.rs deleted file mode 100644 index addb0d8..0000000 --- a/src/server/panel.rs +++ /dev/null @@ -1,30 +0,0 @@ -use axum::{extract::State, response::Response, routing::get, Router}; -use axum_extra::extract::CookieJar; -use maud::html; -use tap::Pipe; - -use crate::server::{store::Store, Nevermind}; - -use super::{account_auth, render_html, ApiState}; - -pub fn bind(app: Router<ApiState>) -> Router<ApiState> { - app.route("/", get(get_panel)) -} - -#[axum::debug_handler(state = ApiState)] -async fn get_panel(jar: CookieJar, State(store): State<Store>) -> Result<Response, Response> { - Ok(account_auth(&jar, &store) - .await - .prompt_login()? - .pipe(render_normal_panel)) -} - -fn render_normal_panel(name: String) -> Response { - render_html( - html!(title { "dissociate" }), - html! { - p { "currently logged in as " (name) } - a href="/logout" { button { "log out" } } - }, - ) -} |