🐛 fix(gmail): fix token persistence path

- Use the persist_path from the config instead of a hardcoded path to ensure tokens are persisted to the correct location
This commit is contained in:
Jeremiah Russell
2025-10-16 15:29:37 +01:00
committed by Jeremiah Russell
parent 368e78b1cc
commit 73e9eed539

View File

@@ -72,13 +72,14 @@ impl GmailClient {
.build(); .build();
let client = Client::builder(executor.clone()).build(connector.clone()); let client = Client::builder(executor.clone()).build(connector.clone());
log::trace!("file to persist tokens to `{}`", config.persist_path());
let auth = InstalledFlowAuthenticator::with_client( let auth = InstalledFlowAuthenticator::with_client(
config.secret().clone(), config.secret().clone(),
InstalledFlowReturnMethod::HTTPRedirect, InstalledFlowReturnMethod::HTTPRedirect,
Client::builder(executor).build(connector), Client::builder(executor).build(connector),
) )
.persist_tokens_to_disk(format!("{}/gmail1", config.config_root())) .persist_tokens_to_disk(config.persist_path())
.build() .build()
.await .await
.unwrap(); .unwrap();