client: Pass x-zed-system-id header in get_authenticated_user() (#55688)

We are going to drive current organization selection with server side
state, so we need to know which installation we are on so the server can
return the correct currently selected organization. Next step will be
using the organization from the response and removing the locally
persisted current organization id.

Part of CLO-716

Release Notes:

- N/A
This commit is contained in:
Tom Houlé
2026-05-04 21:08:24 +02:00
committed by GitHub
parent 07e57bb488
commit 2c5fcfc24a
2 changed files with 20 additions and 9 deletions
@@ -74,15 +74,20 @@ impl CloudApiClient {
pub async fn get_authenticated_user(
&self,
system_id: Option<String>,
) -> Result<GetAuthenticatedUserResponse, ClientApiError> {
let request = self.build_request(
Request::builder().method(Method::GET).uri(
let request_builder = Request::builder()
.method(Method::GET)
.uri(
self.http_client
.build_zed_cloud_url("/client/users/me")?
.as_ref(),
),
AsyncBody::default(),
)?;
)
.when_some(system_id, |builder, system_id| {
builder.header(ZED_SYSTEM_ID_HEADER_NAME, system_id)
});
let request = self.build_request(request_builder, AsyncBody::default())?;
let mut response = self.http_client.send(request).await?;