aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2021-05-18 23:31:11 +0200
committerTeddy Wing2021-05-18 23:31:11 +0200
commitad6878f276b8c712bcf5001e3c81743031a16da3 (patch)
tree95c2ce2c68d3c752ffefb09c8cb822d79ce4ce4d /src
parente9f8a79bf51068ea0405f3148567edbbc98d7596 (diff)
downloadgoogle-calendar-rsvp-ad6878f276b8c712bcf5001e3c81743031a16da3.tar.bz2
Save OAuth2 tokens to disk
So we don't ask for authorisation on every run.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 9bd94bb..709591f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,7 +16,13 @@ async fn main() {
let auth = oauth2::InstalledFlowAuthenticator::builder(
secret,
oauth2::InstalledFlowReturnMethod::HTTPRedirect,
- ).build().await.unwrap();
+ )
+ .persist_tokens_to_disk(
+ home::home_dir()
+ .unwrap()
+ .join(".google-service-cli/google-calendar-rsvp")
+ )
+ .build().await.unwrap();
let hub = CalendarHub::new(
hyper::Client::builder()