omniauth-intercom 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/CHANGELOG.md +9 -3
- data/lib/omniauth/intercom/version.rb +1 -1
- data/lib/omniauth/strategies/intercom.rb +17 -2
- data/omniauth-intercom.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bf15af1eeacf96af125225fe34ee4d9542c3903
|
4
|
+
data.tar.gz: 32add95875eaf5a13d0bddcb9380699b6e515eae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f064f379bb6246a1bdb1bbd0130a43c3f2725e8f528befc4c38f5cbadf06f423c2f6b341afdc4b77159980d3081d0525f5b494e1d2f2b88830cd7e8790910a85
|
7
|
+
data.tar.gz: 5c71830b5e42722f239a7956fa4c560970f5b55b2772aaee89f87f5f20a1984fee39e0fd6cd66f938946b95a33ce105158f49a83d14e8f34d6b76a6056d0ca57
|
data/CHANGELOG.md
CHANGED
@@ -10,8 +10,14 @@ Features:
|
|
10
10
|
|
11
11
|
- Add support for signup (@Skaelv)
|
12
12
|
|
13
|
-
|
13
|
+
## 0.1.2 (2016-06-14)
|
14
14
|
|
15
|
-
|
15
|
+
Features:
|
16
|
+
|
17
|
+
- add support for avatar (thanks @bnorton)
|
18
|
+
|
19
|
+
## 0.1.3 (2016-07-26)
|
20
|
+
|
21
|
+
Features:
|
16
22
|
|
17
|
-
|
23
|
+
- allow to pre-populate oauth signup form fields (name, email, app_name) (@Skaelv)
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'omniauth-oauth2'
|
2
|
+
require 'uri'
|
3
|
+
|
2
4
|
module OmniAuth
|
3
5
|
module Strategies
|
4
6
|
class Intercom < OmniAuth::Strategies::OAuth2
|
@@ -36,8 +38,7 @@ module OmniAuth
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def request_phase
|
39
|
-
|
40
|
-
|
41
|
+
prepopulate_signup_fields_form if request.params.fetch('signup', false)
|
41
42
|
super
|
42
43
|
end
|
43
44
|
|
@@ -48,6 +49,20 @@ module OmniAuth
|
|
48
49
|
access_token.client.connection.headers['Accept'] = "application/vnd.intercom.3+json"
|
49
50
|
end
|
50
51
|
|
52
|
+
def prepopulate_signup_fields_form
|
53
|
+
options.client_options[:authorize_url] += '/signup'
|
54
|
+
signup_hash = signup_fields_hash
|
55
|
+
options.client_options[:authorize_url] += '?' + signup_hash.map{|k,v| [CGI.escape(k.to_s), "=", CGI.escape(v.to_s)]}.map(&:join).join("&") unless signup_hash.empty?
|
56
|
+
end
|
57
|
+
|
58
|
+
def signup_fields_hash
|
59
|
+
hash = {}
|
60
|
+
['name', 'email', 'app_name'].each do |field_name|
|
61
|
+
hash[field_name] = request.params.fetch(field_name) if request.params.fetch(field_name, false)
|
62
|
+
end
|
63
|
+
return hash
|
64
|
+
end
|
65
|
+
|
51
66
|
end
|
52
67
|
end
|
53
68
|
end
|
data/omniauth-intercom.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-intercom
|
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
|
- Kevin Antoine
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.6'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.6'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- kevin.antoine@intercom.io
|
@@ -108,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
122
|
version: '0'
|
109
123
|
requirements: []
|
110
124
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.6.1
|
112
126
|
signing_key:
|
113
127
|
specification_version: 4
|
114
128
|
summary: Intercom OAuth2 Strategy for OmniAuth
|