From 6dd6e46aab0361bbb3f7005a27b628b3960514ec Mon Sep 17 00:00:00 2001 From: catvayor Date: Mon, 17 Jun 2024 09:11:01 +0200 Subject: [PATCH] cleanner admin auth --- src/admin.rs | 105 ++++++++++++++++++++++++++------------------------ src/global.rs | 1 - src/main.rs | 3 -- 3 files changed, 54 insertions(+), 55 deletions(-) diff --git a/src/admin.rs b/src/admin.rs index ce3ce4e..cfdb6a9 100644 --- a/src/admin.rs +++ b/src/admin.rs @@ -1,4 +1,6 @@ use rocket::{ + http::Status, + request::{self, FromRequest, Outcome, Request}, response::stream::{Event, EventStream}, serde::json::Json, tokio::{ @@ -11,74 +13,75 @@ use rocket_dyn_templates::{context, Template}; use crate::global::*; -#[get("/?&")] -fn admin_page( - tok: Option, - dbg: Option, - admin_key: &State, -) -> Option