omniauth-osso 0.1.8 → 0.2.0
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/lib/omniauth-osso/version.rb +1 -1
- data/lib/omniauth/strategies/osso.rb +7 -4
- data/spec/omniauth/strategies/osso_spec.rb +36 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 257baf2f9360500ab7c89d965a6591ed5f19fae096435b409c14ab5398d35e1a
|
4
|
+
data.tar.gz: 1ce66747bf46e62db83a24b73c312ae2c32fd0455a41784fb8654de14e1dd372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76e37f338722da1d8742df1c744e4e21303bb5796e7cba8b9744eb028dfc4b33a5570eced3ecb63f8029252bbb2322af612da954b7fea4456a063ef3f29fafed
|
7
|
+
data.tar.gz: 48f549fce5708546952078bd4b8180edc1d76685d24109c08d3a15d30fb0df7ea92f8d057f8beeb4cf96b77a22511fe63e7a65e1fd77644d0fbffaddf222d497
|
data/Gemfile.lock
CHANGED
@@ -88,10 +88,13 @@ module OmniAuth
|
|
88
88
|
def user_param
|
89
89
|
return @user_param if defined?(@user_param)
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}
|
91
|
+
params = request.params.reject { |_k, v| v.empty? }
|
92
|
+
|
93
|
+
@user_param = {}
|
94
|
+
@user_param = { domain: request.params['domain'] } if params['domain']
|
95
|
+
@user_param = { email: request.params['email'] } if params['email']
|
96
|
+
|
97
|
+
@user_param
|
95
98
|
end
|
96
99
|
end
|
97
100
|
end
|
@@ -70,13 +70,48 @@ describe OmniAuth::Strategies::Osso do
|
|
70
70
|
expect(instance.request_params[:domain]).to eq('example.com')
|
71
71
|
end
|
72
72
|
|
73
|
-
it 'includes email
|
73
|
+
it 'includes email passed as a request param' do
|
74
74
|
instance = subject.new('abc', 'def')
|
75
75
|
instance.env = {}
|
76
76
|
allow(instance).to receive(:request) do
|
77
77
|
double('Request', params: { 'email' => 'user@example.com' }, scheme: 'https', url: url)
|
78
78
|
end
|
79
|
+
|
80
|
+
expect(instance.request_params[:email]).to eq('user@example.com')
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'only includes email as a request param when both keys are provided' do
|
84
|
+
instance = subject.new('abc', 'def')
|
85
|
+
instance.env = {}
|
86
|
+
allow(instance).to receive(:request) do
|
87
|
+
double('Request', params: { 'email' => 'user@example.com', 'domain' => 'example.com' }, scheme: 'https',
|
88
|
+
url: url)
|
89
|
+
end
|
90
|
+
|
79
91
|
expect(instance.request_params[:email]).to eq('user@example.com')
|
92
|
+
expect(instance.request_params.keys).to_not include(:domain)
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'domain as a request param when email key is a blank string' do
|
96
|
+
instance = subject.new('abc', 'def')
|
97
|
+
instance.env = {}
|
98
|
+
allow(instance).to receive(:request) do
|
99
|
+
double('Request', params: { 'email' => '', 'domain' => 'example.com' }, scheme: 'https',
|
100
|
+
url: url)
|
101
|
+
end
|
102
|
+
|
103
|
+
expect(instance.request_params[:domain]).to eq('example.com')
|
104
|
+
expect(instance.request_params.keys).to_not include(:email)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'only includes redirect_uri as a request param if neither email or domain are provided' do
|
108
|
+
instance = subject.new('abc', 'def')
|
109
|
+
instance.env = {}
|
110
|
+
allow(instance).to receive(:request) do
|
111
|
+
double('Request', params: {}, scheme: 'https', url: url)
|
112
|
+
end
|
113
|
+
|
114
|
+
expect(instance.request_params.keys).to eq([:redirect_uri])
|
80
115
|
end
|
81
116
|
end
|
82
117
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-osso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Bauch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|