Fix: Give log out method `session_identification` properly

This commit is contained in:
Mahesh Bansod 2021-10-23 02:09:33 +05:30
parent cf818dd914
commit 8811df7323
2 changed files with 5 additions and 4 deletions

View File

@ -190,8 +190,6 @@ impl Client {
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_should_get_a_session() {}
#[tokio::test]
async fn it_should_log_in_and_get_the_correct_peer() -> Result<(), Error> {
@ -217,11 +215,12 @@ mod tests {
}
_ => {}
}
println!("Authenticated. Getting the peer");
let peer = client.get_me(0).await?;
client.logout(0).await?;
println!("{:?}", peer);
client.logout(0).await?;
assert_eq!(
peer.username,
creds["username"].as_str().unwrap().to_string()

View File

@ -109,7 +109,9 @@ impl SessionHolder {
let response = rpc_client
.send_request(
"session.logout",
serde_json::value::to_value(session_identification)?,
json!({
"session_identification":serde_json::value::to_value(session_identification)?
}),
)
.await?;
self.authenticated = false;