Authentication how handled as seperate router

This commit is contained in:
Jack Mechem 2026-03-28 16:02:14 -07:00
parent 0cf00faf78
commit e47ad30a10
4 changed files with 24 additions and 27 deletions

View file

@ -1,6 +1,4 @@
use axum::{
http::HeaderMap, http::StatusCode, response::IntoResponse,
};
use axum::{http::HeaderMap, http::StatusCode, response::IntoResponse};
use zbus::Connection;
use crate::auth;
@ -8,11 +6,6 @@ use crate::models;
// POST /system/reboot
pub async fn system_reboot(headers: HeaderMap) -> impl IntoResponse {
if !auth::verify_token(&headers) {
return models::ActionResponse::err(StatusCode::UNAUTHORIZED, "Unauthorized")
.into_response();
}
let conn = match Connection::system().await {
Ok(c) => c,
Err(e) => {