update_progress doesn't work yet
This commit is contained in:
parent
a671e79f1a
commit
c870aa8c93
1 changed files with 0 additions and 15 deletions
15
src/main.rs
15
src/main.rs
|
@ -88,24 +88,9 @@ fn authorize(username: &str, password: &str) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn auth_user(headers: HeaderMap) -> StatusCode {
|
async fn auth_user(headers: HeaderMap) -> StatusCode {
|
||||||
//let client = redis::Client::open("redis://127.0.0.1/").unwrap();
|
|
||||||
//let mut con = client.get_connection().unwrap();
|
|
||||||
|
|
||||||
let username = headers["x-auth-user"].to_str().unwrap_or("");
|
let username = headers["x-auth-user"].to_str().unwrap_or("");
|
||||||
let password = headers["x-auth-key"].to_str().unwrap_or("");
|
let password = headers["x-auth-key"].to_str().unwrap_or("");
|
||||||
|
|
||||||
/*if username.is_empty() || password.is_empty() {
|
|
||||||
return StatusCode::UNAUTHORIZED;
|
|
||||||
}
|
|
||||||
|
|
||||||
let user_key = format!("user:{username}:key");
|
|
||||||
|
|
||||||
let redis_pw: String = con.get(&user_key).unwrap();
|
|
||||||
|
|
||||||
if password != redis_pw {
|
|
||||||
return StatusCode::UNAUTHORIZED;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if authorize(&username, &password) == false {
|
if authorize(&username, &password) == false {
|
||||||
return StatusCode::UNAUTHORIZED;
|
return StatusCode::UNAUTHORIZED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue