From bb2e450bace30f2e9b40dbd038b172484073530e Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Nov 2015 21:16:58 +0000 Subject: working get-token --- get-oauth2-token | 8 +++++--- 1 file 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); -- cgit v1.2.3