This commit is contained in:
root 2024-10-22 09:33:29 +02:00
parent 81023f2042
commit 26301ac344
2 changed files with 5 additions and 7 deletions

2
Cargo.lock generated
View File

@ -4,7 +4,7 @@ version = 3
[[package]]
name = "BitAuth"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"bb8",
"bcrypt",

View File

@ -258,13 +258,11 @@ async fn handle_connection(req: Request<Incoming>, pool: DBPool, ip: String) ->
headers.insert(hyper::header::CONTENT_TYPE, restype);
parts.headers = headers;
if logged {
let body = body.replace("{USER_STATUS}", "AUTHORIZED");
let user_status = match logged {
true => "AUTHORIZED",
_ => "NOT AUTHORIZED"
}
else {
let body = body.replace("{USER_STATUS}", "NOT AUTHORIZED");
}
let body = body.replace("{USER_STATUS}", user_status);
let body = body.replace("{PAGE_TIME}", &format!("{}", time_mcs() - t));
Ok(Response::from_parts(parts, Full::new(Bytes::from(body))))
}