google-oauth2-installed 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/google-oauth2-installed/access_token.rb +2 -3
- data/lib/google-oauth2-installed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95b5c8efb29171eafe7639e80724f2aa13c1b964
|
4
|
+
data.tar.gz: 587b84d73dec719055cdb7112cacb835bf5f9d5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30bcc8f5453dc332138c80dc67c7b04c17e3b17038f42d85a49bf9797c35ababd5ffb827027b9c0fe7a38436eccff61a629fa9b96ae7ec2ab38d31055e6c816c
|
7
|
+
data.tar.gz: 1d3d68b22cd22e1c68870de111bd07ddc55bb3c333163d0d4b3589d2d5c058b64f53746a58a2ee328f1ec94c9a93bf1465d39f0806154408e7ffd08f8b9e9af5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -88,7 +88,7 @@ Once you have these environment variables defined, run this rake task and
|
|
88
88
|
authenticate to google with the user you need access as.
|
89
89
|
|
90
90
|
```
|
91
|
-
rake
|
91
|
+
rake googleoauth2installed:get_access_token
|
92
92
|
```
|
93
93
|
|
94
94
|
This rake task will give you a url to load up in the browser. You will need to log in
|
@@ -96,6 +96,8 @@ to Google, allow access to the requested scopes, and copy the provided code. Pas
|
|
96
96
|
this code back in to the rake task that is waiting for you. It will then output the
|
97
97
|
rest of the environment variables you need to authenticate.
|
98
98
|
|
99
|
+
(If the URL shows an error, you may need to supply a Product Name under the Consent Screen section of your Google Developers Console.)
|
100
|
+
|
99
101
|
If you are using `.env`, it should now look something like:
|
100
102
|
|
101
103
|
```shell
|
@@ -4,9 +4,8 @@ module GoogleOauth2Installed
|
|
4
4
|
class AccessToken < Struct.new(:credentials)
|
5
5
|
|
6
6
|
def access_token
|
7
|
-
OAuth2::AccessToken.from_hash(client, token_hash)
|
8
|
-
|
9
|
-
end
|
7
|
+
token = OAuth2::AccessToken.from_hash(client, token_hash)
|
8
|
+
token.expired? ? token.refresh! : token
|
10
9
|
end
|
11
10
|
|
12
11
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-oauth2-installed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amiel Martin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|