Skip to content

Commit

Permalink
support disable_session_token
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Nov 6, 2024
1 parent 8290a85 commit 0d14313
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl APIClient {
let mut client = Self::from_dsn(dsn).await?;
client.build_client(name).await?;
client.check_presign().await?;
if !client.disable_session_token {
if !client.disable_login {
client.login().await?;
}
Ok(client)
Expand Down Expand Up @@ -628,7 +628,10 @@ impl APIClient {
let endpoint = self.endpoint.join("/v1/session/login")?;
let headers = self.make_headers(None)?;
let body = LoginRequest::from(&*self.session_state.lock());
let builder = self.cli.post(endpoint.clone()).json(&body);
let mut builder = self.cli.post(endpoint.clone()).json(&body);
if self.disable_session_token {
builder = builder.query(&[("disable_session_token", true)]);
}
let builder = self.auth.wrap(builder)?;
let request = builder
.headers(headers.clone())
Expand Down Expand Up @@ -936,7 +939,7 @@ impl Default for APIClient {
presign: PresignMode::Auto,
route_hint: Arc::new(RouteHintGenerator::new()),
last_node_id: Arc::new(Default::default()),
disable_session_token: false,
disable_session_token: true,
disable_login: false,
session_token_info: None,
server_version: None,
Expand Down

0 comments on commit 0d14313

Please sign in to comment.