google_sign_in 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -12
- data/README.md +1 -11
- data/google_sign_in.gemspec +2 -2
- data/lib/google_sign_in/helper.rb +6 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7270439ab30f7671a23b2284ca7db4d384a5f96
|
4
|
+
data.tar.gz: 51c1f1f402dbf464def14b68fd181e177b846fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e81ae78ed6bd5ef42ff7e81df6b09a9847ca183443a9a2e55688eea31af5d436391f85b18d46f58a4198555c212e6ef5df5469d24c195152e074c88b8948dda3
|
7
|
+
data.tar.gz: 5c2974784dff4008339b849c4e8f9655ddf76dda8c9ff7025f53240f90069bd29b8f7e2d35d8c5b137ceaf00522889e972717e68ccd0dfe0363fd97ca435ecc4
|
data/Gemfile.lock
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
google_sign_in (0.1)
|
4
|
+
google_sign_in (0.1.2)
|
5
5
|
activesupport (>= 5.1)
|
6
|
-
google-id-token (>= 1.
|
6
|
+
google-id-token (>= 1.4.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (5.1.
|
11
|
+
activesupport (5.1.3)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (~> 0.7)
|
14
14
|
minitest (~> 5.1)
|
15
15
|
tzinfo (~> 1.1)
|
16
|
-
byebug (9.0
|
16
|
+
byebug (9.1.0)
|
17
17
|
concurrent-ruby (1.0.5)
|
18
|
-
google-id-token (1.
|
19
|
-
jwt
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
minitest (5.10.2)
|
24
|
-
multi_json (1.12.1)
|
18
|
+
google-id-token (1.4.0)
|
19
|
+
jwt (>= 1)
|
20
|
+
i18n (0.8.6)
|
21
|
+
jwt (2.0.0)
|
22
|
+
minitest (5.10.3)
|
25
23
|
rake (12.0.0)
|
26
24
|
thread_safe (0.3.6)
|
27
25
|
tzinfo (1.2.3)
|
@@ -37,4 +35,4 @@ DEPENDENCIES
|
|
37
35
|
rake
|
38
36
|
|
39
37
|
BUNDLED WITH
|
40
|
-
1.15.
|
38
|
+
1.15.4
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ tutorial on how to setup a client id](https://developers.google.com/identity/sig
|
|
10
10
|
Once you have your client id, create a `config/initializers/google_sign_in_client_id.rb` file with this:
|
11
11
|
`GoogleSignIn::Identity.client_id = <THAT CLIENT ID YOU GOT FROM GOOGLE>`
|
12
12
|
|
13
|
-
Now you can use the sign-in integration on your signup or
|
13
|
+
Now you can use the sign-in integration on your signup or signin screen.
|
14
14
|
|
15
15
|
## Example
|
16
16
|
|
@@ -73,19 +73,9 @@ the decoding of the Google ID Token using the google-id-token library. Interroga
|
|
73
73
|
for profile details is particularly helpful when you use Google for signup, as you can get the name, email
|
74
74
|
address, avatar url, and locale through it.
|
75
75
|
|
76
|
-
## Unreleased gem caveat
|
77
|
-
|
78
|
-
The gem google-id-token is currently behind its GitHub repository on the release schedule. The latest release
|
79
|
-
is version 1.3.1 from 2015. So for now, you should depend on the github version in your app's Gemfile:
|
80
|
-
|
81
|
-
```ruby
|
82
|
-
gem 'google-id-token', github: 'google/google-id-token'
|
83
|
-
```
|
84
|
-
|
85
76
|
## Outstanding work
|
86
77
|
|
87
78
|
- Proper testing. Need to generate a test client_id/google id token combo that we can use to test with.
|
88
|
-
- Cajole Google to release a new version of the google-id-token so caveat can be removed.
|
89
79
|
- Not much more. I'm seeking to keep this simple, just for signin/signup, not general Google integration.
|
90
80
|
|
91
81
|
## License
|
data/google_sign_in.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'google_sign_in'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.3'
|
4
4
|
s.authors = 'David Heinemeier Hansson'
|
5
5
|
s.email = 'david@basecamp.com'
|
6
6
|
s.summary = 'Sign in (or up) with Google for Rails applications'
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.required_ruby_version = '>= 1.9.3'
|
11
11
|
|
12
12
|
s.add_dependency 'activesupport', '>= 5.1'
|
13
|
-
s.add_dependency 'google-id-token', '>= 1.
|
13
|
+
s.add_dependency 'google-id-token', '>= 1.4.0'
|
14
14
|
|
15
15
|
s.add_development_dependency 'bundler', '~> 1.15'
|
16
16
|
|
@@ -2,13 +2,13 @@ require 'google_sign_in/identity'
|
|
2
2
|
|
3
3
|
module GoogleSignIn
|
4
4
|
module Helper
|
5
|
-
def google_sign_in(
|
5
|
+
def google_sign_in(**form_options, &block)
|
6
6
|
content_for :head,
|
7
7
|
google_sign_in_javacript_include_tag +
|
8
8
|
google_sign_in_client_id_meta_tag
|
9
9
|
|
10
10
|
google_sign_in_javascript_tag +
|
11
|
-
google_sign_in_hidden_form_tag(
|
11
|
+
google_sign_in_hidden_form_tag(**form_options) +
|
12
12
|
google_sign_in_click_handler(&block)
|
13
13
|
end
|
14
14
|
|
@@ -24,8 +24,10 @@ module GoogleSignIn
|
|
24
24
|
tag.meta name: "google-signin-client_id", content: GoogleSignIn::Identity.client_id
|
25
25
|
end
|
26
26
|
|
27
|
-
def google_sign_in_hidden_form_tag(
|
28
|
-
|
27
|
+
def google_sign_in_hidden_form_tag(**options)
|
28
|
+
options.reverse_merge!(html: { style: "display: none" })
|
29
|
+
|
30
|
+
form_with(**options) do |form|
|
29
31
|
form.hidden_field(:google_id_token, id: "google_sign_in_token") + form.submit(id: "google_sign_in_submit")
|
30
32
|
end
|
31
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_sign_in
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.4.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.5.1
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Sign in (or up) with Google for Rails applications
|