Structural changes, move auth to separate module .

This commit is contained in:
Ara Sadoyan
2026-09-20 18:57:45 +02:00
parent 5fdfa17265
commit 4ae92a264b
11 changed files with 254 additions and 27 deletions
+2 -20
View File
@@ -1,3 +1,4 @@
/*
use crate::utils::jwt::{check_jwt, JWT_TOKEN};
use crate::utils::structs::InnerAuth;
pub(crate) use crate::utils::tools::split_host_port;
@@ -224,23 +225,4 @@ pub fn get_query_param(session: &mut Session, key: &str) -> Option<String> {
.collect();
params.get(key).and_then(|v| decode(v).ok()).map(|s| s.to_string())
}
// #[allow(clippy::needless_return)]
// pub fn split_host_port(addr: &str, tls: bool) -> Option<(&str, u16, bool, &str)> {
// match addr.split_once(':') {
// Some((h, p)) => match p.parse::<u16>() {
// Ok(port) => return Some((h, port, tls, h)),
// Err(_) => {
// log::warn!("ForwardAuth: invalid port in {}", addr);
// return None;
// }
// },
// None => {
// if tls {
// return Some((addr, 443u16, tls, addr));
// } else {
// return Some((addr, 80u16, tls, addr));
// }
// }
// };
// }
*/