proxmox-rest-server: do not use formatter for AuthErr

We want to get a 401 error at HTTP level.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dietmar Maurer 2023-11-27 11:17:08 +01:00 committed by Wolfgang Bumiller
parent 6b59158aaf
commit 804b7e82ff

View File

@ -996,7 +996,7 @@ impl Formatted {
// always delay unauthorized calls by 3 seconds (from start of request)
let err = http_err!(UNAUTHORIZED, "authentication failed - {}", err);
tokio::time::sleep_until(Instant::from_std(delay_unauth_time())).await;
return Ok(formatter.format_error(err));
return Err(err);
}
}
}