summaryrefslogtreecommitdiff
path: root/get-oauth2-token
diff options
context:
space:
mode:
Diffstat (limited to 'get-oauth2-token')
-rw-r--r--get-oauth2-token8
1 files changed, 5 insertions, 3 deletions
diff --git a/get-oauth2-token b/get-oauth2-token
index 749863c..5db32d3 100644
--- a/get-oauth2-token
+++ b/get-oauth2-token
@@ -15,7 +15,9 @@ my $oauth2 = Net::Google::DataAPI::Auth::OAuth2->new(
scope => ['https://www.googleapis.com/auth/calendar.readonly'],
);
my $url = $oauth2->authorize_url();
-my $code = prompt('x', "Go to $url, then paste the code: ", '', '');
+say "Go to:";
+say $url;
+my $code = prompt('x', "then paste the code: ", '', '');
my $token = $oauth2->get_access_token($code) or die;
-$config{oauth2}->{token}=$token;
-$config_file->save('google-to-text.conf',\%config);
+$config{oauth2}->{token}=$token->session_freeze;
+$config_file->save_file('google-to-text.conf',\%config);