From 5f1a75a6e4edf92f9227dc483cda7ba3583e310e Mon Sep 17 00:00:00 2001 From: Nabeel Amjad Date: Wed, 10 Aug 2016 01:34:38 +0000 Subject: [PATCH] Bump version to 0.1.7 and add error handler for token --- CHANGELOG.md | 2 +- README.md | 4 ++-- lib/poke-api/auth/google.rb | 2 ++ lib/poke-api/version.rb | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 961e814..da5556e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Changelog ------------------ -0.1.6 (10-08-2016) +0.1.7 (10-08-2016) ------------------ * **Feature** - You can now provide a ``HTTPClient`` instantation for proxy purposes - ```ruby diff --git a/README.md b/README.md index c656acb..986850d 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,10 @@ You can use bundler and refer directly to this repository ``` gem 'poke-go-api', git: "https://github.com/nabeelamjad/poke-api.git", - tag: '0.1.6' + tag: '0.1.7' ``` -Or, alternatively you can download the repository and run ``gem build poke-api.gemspec`` followed with ``gem install poke-api-0.1.6.gem`` +Or, alternatively you can download the repository and run ``gem build poke-api.gemspec`` followed with ``gem install poke-api-0.1.7.gem`` The gem is also available by using ``gem install poke-go-api`` (poke-api was taken as a name already). diff --git a/lib/poke-api/auth/google.rb b/lib/poke-api/auth/google.rb index 47b7a92..1f5db15 100755 --- a/lib/poke-api/auth/google.rb +++ b/lib/poke-api/auth/google.rb @@ -57,6 +57,8 @@ def access_token_from_refresh_token @access_token = data['id_token'] @expiry = data['expires_in'].to_i + Helpers.fetch_time(ms: false) + + raise 'Invalid refresh token' unless data['id_token'] end def perform_request(method) diff --git a/lib/poke-api/version.rb b/lib/poke-api/version.rb index 1a5b000..b8b26d7 100644 --- a/lib/poke-api/version.rb +++ b/lib/poke-api/version.rb @@ -1,5 +1,5 @@ module Poke module API - VERSION = '0.1.6'.freeze + VERSION = '0.1.7'.freeze end end