server/REST: check auth: code cleanup, better variable names

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-10-12 18:39:45 +02:00
parent ea545b395b
commit 6c5bdef567
1 changed files with 5 additions and 5 deletions

View File

@ -329,16 +329,16 @@ pub async fn handle_api_request<Env: RpcEnvironment, S: 'static + BuildHasher +
fn get_index(
userid: Option<Userid>,
token: Option<String>,
csrf_token: Option<String>,
language: Option<String>,
api: &Arc<ApiConfig>,
parts: Parts,
) -> Response<Body> {
let nodename = proxmox::tools::nodename();
let userid = userid.as_ref().map(|u| u.as_str()).unwrap_or("");
let user = userid.as_ref().map(|u| u.as_str()).unwrap_or("");
let token = token.unwrap_or_else(|| String::from(""));
let csrf_token = csrf_token.unwrap_or_else(|| String::from(""));
let mut debug = false;
let mut template_file = "index";
@ -362,8 +362,8 @@ fn get_index(
let data = json!({
"NodeName": nodename,
"UserName": userid,
"CSRFPreventionToken": token,
"UserName": user,
"CSRFPreventionToken": csrf_token,
"language": lang,
"debug": debug,
});