diff options
| author | Teddy Wing | 2021-05-18 23:31:11 +0200 |
|---|---|---|
| committer | Teddy Wing | 2021-05-18 23:31:11 +0200 |
| commit | ad6878f276b8c712bcf5001e3c81743031a16da3 (patch) | |
| tree | 95c2ce2c68d3c752ffefb09c8cb822d79ce4ce4d /src | |
| parent | e9f8a79bf51068ea0405f3148567edbbc98d7596 (diff) | |
| download | google-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.rs | 8 |
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() |
