diff --git a/utilities/src/bin/snoozer.rs b/utilities/src/bin/snoozer.rs index 135baae..623c766 100644 --- a/utilities/src/bin/snoozer.rs +++ b/utilities/src/bin/snoozer.rs @@ -7,6 +7,7 @@ use kordophone::{ APIInterface, }; use kordophone::api::http_client::Credentials; +use kordophone::api::AuthenticationStore; use futures_util::StreamExt; use hyper::Uri; @@ -49,9 +50,10 @@ async fn main() -> Result<(), Box> { let auth_store = InMemoryAuthenticationStore::new(Some(credentials.clone())); let mut client = HTTPAPIClient::new(server_url, auth_store); - // Authenticate first - let _token = client.authenticate(credentials).await?; - println!("Authenticated successfully"); + // Authenticate first (and set token manually in case the client doesn't) + let token = client.authenticate(credentials).await?; + client.auth_store.set_token(token.to_string()).await; + println!("Authenticated successfully: {:?}", token); // Open event socket let event_socket = client.open_event_socket(None).await?;