server/REST: check auth: code cleanup, better variable names
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
ea545b395b
commit
6c5bdef567
@ -329,16 +329,16 @@ pub async fn handle_api_request<Env: RpcEnvironment, S: 'static + BuildHasher +
|
|||||||
|
|
||||||
fn get_index(
|
fn get_index(
|
||||||
userid: Option<Userid>,
|
userid: Option<Userid>,
|
||||||
token: Option<String>,
|
csrf_token: Option<String>,
|
||||||
language: Option<String>,
|
language: Option<String>,
|
||||||
api: &Arc<ApiConfig>,
|
api: &Arc<ApiConfig>,
|
||||||
parts: Parts,
|
parts: Parts,
|
||||||
) -> Response<Body> {
|
) -> Response<Body> {
|
||||||
|
|
||||||
let nodename = proxmox::tools::nodename();
|
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 debug = false;
|
||||||
let mut template_file = "index";
|
let mut template_file = "index";
|
||||||
@ -362,8 +362,8 @@ fn get_index(
|
|||||||
|
|
||||||
let data = json!({
|
let data = json!({
|
||||||
"NodeName": nodename,
|
"NodeName": nodename,
|
||||||
"UserName": userid,
|
"UserName": user,
|
||||||
"CSRFPreventionToken": token,
|
"CSRFPreventionToken": csrf_token,
|
||||||
"language": lang,
|
"language": lang,
|
||||||
"debug": debug,
|
"debug": debug,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user