[pbs-devel] [PATCH proxmox 1/1] auth-api: include meta information required by extjs in api endpoints
Shannon Sterz
s.sterz at proxmox.com
Thu Jul 10 15:50:07 CEST 2025
otherwise extjs will assume the requests failed even though they were
successful.
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(),
+ )?)
})
}
--
2.39.5
More information about the pbs-devel
mailing list