[pbs-devel] [PATCH proxmox 1/1] auth-api: include meta information required by extjs in api endpoints
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Jul 16 00:40:41 CEST 2025
Am 10.07.25 um 15:50 schrieb Shannon Sterz:
> otherwise extjs will assume the requests failed even though they were
> successful.
Potentially dumb question, but is this then only returning that for the
extjs formatter or also for the json one?
>
> Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
> ---
> proxmox-auth-api/src/api/access.rs | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/proxmox-auth-api/src/api/access.rs b/proxmox-auth-api/src/api/access.rs
> index fdf52185..f5111d4a 100644
> --- a/proxmox-auth-api/src/api/access.rs
> +++ b/proxmox-auth-api/src/api/access.rs
> @@ -6,7 +6,6 @@ use http::Response;
> use openssl::hash::MessageDigest;
> use serde_json::{json, Value};
>
> -use proxmox_http::Body;
> use proxmox_rest_server::{extract_cookie, RestEnvironment};
> use proxmox_router::{
> http_err, ApiHandler, ApiMethod, ApiResponseFuture, Permission, RpcEnvironment,
> @@ -93,7 +92,11 @@ fn logout_handler(
>
> Ok(Response::builder()
> .header(hyper::header::SET_COOKIE, host_cookie)
> - .body(Body::empty())?)
> + .body(
> + json!({"data": {}, "status": 200, "success": true })
> + .to_string()
> + .into(),
> + )?)
> })
> }
>
> @@ -179,7 +182,11 @@ fn create_ticket_http_only(
> }
> }
>
> - Ok(response.body(json!({"data": ticket_response }).to_string().into())?)
> + Ok(response.body(
> + json!({"data": ticket_response, "status": 200, "success": true })
> + .to_string()
> + .into(),
> + )?)
> })
> }
>
More information about the pbs-devel
mailing list