Added access token and device id persistance. Fixes #3

This commit is contained in:
Philip (a-0) 2022-08-30 10:49:20 +02:00
parent efc38e161c
commit 832c94069c
2 changed files with 6 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
/target
config.yaml
config.yaml*

View file

@ -39,6 +39,11 @@ pub async fn get_clients(config: &mut Config) -> Vec<Client> {
}
}
}
// If client is logged in, update the config to persist the session
if let Some(session) = client.session().await {
conf.access_token = Some(session.access_token);
conf.device_id = Some(session.device_id.to_string());
}
clients.push(client.clone());
}