more fix
This commit is contained in:
parent
81023f2042
commit
26301ac344
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4,7 +4,7 @@ version = 3
|
||||
|
||||
[[package]]
|
||||
name = "BitAuth"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"bb8",
|
||||
"bcrypt",
|
||||
|
10
src/main.rs
10
src/main.rs
@ -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))))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user