omniauth-identity 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/omniauth-identity/version.rb +1 -1
- data/lib/omniauth/strategies/identity.rb +6 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26637a55190cccdef70e9a1fc568005e23b7ebff9ba3ec6d2f5ea4398117f04d
|
4
|
+
data.tar.gz: d31d884aae50bd00c0d3820030c107def5bbcaf6507eb5628e068ac090ccc8c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86f91851a1e9884d95e3b3d765176f8faed5c7acbf7d79e168d803a09275c228a5cfe1221ee5fedd69689fccbc2af04d4857342bf5ae273f7a4d873a5e7e36c7
|
7
|
+
data.tar.gz: 81462770cbbd476db63d133831a36710178fef1702f5277a8a13248c17bf3fd91bba74f81337239b43202b10c079a3196f2ce912452c803e387c13b0c7361214
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
8
8
|
|
9
9
|
## [Unreleased]
|
10
10
|
|
11
|
+
## [3.0.8] - 2021-03-24
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
- \[Model\] Fixes 2 issues raised in a comment on PR [#108](https://github.com/omniauth/omniauth-identity/pull/108#issuecomment-804456604)
|
16
|
+
- When `options[:on_validation]` is set `new`/`save`/`persisted?` logic is used.
|
17
|
+
- When `options[:on_validation]` is not set `create`/`persisted?` logic is used.
|
18
|
+
|
11
19
|
## [3.0.7] - 2021-03-23
|
12
20
|
|
13
21
|
### Fixed
|
@@ -76,17 +76,19 @@ module OmniAuth
|
|
76
76
|
if model.respond_to?(:column_names) && model.column_names.include?('provider')
|
77
77
|
attributes.reverse_merge!(provider: 'identity')
|
78
78
|
end
|
79
|
-
|
80
|
-
|
79
|
+
if validating?
|
80
|
+
@identity = model.new(attributes)
|
81
81
|
env['omniauth.identity'] = @identity
|
82
|
-
if
|
82
|
+
if valid?
|
83
83
|
@identity.save
|
84
84
|
registration_result
|
85
85
|
else
|
86
86
|
registration_failure(options[:validation_failure_message])
|
87
87
|
end
|
88
88
|
else
|
89
|
-
|
89
|
+
@identity = model.create(attributes)
|
90
|
+
env['omniauth.identity'] = @identity
|
91
|
+
registration_result
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|
@@ -141,10 +143,6 @@ module OmniAuth
|
|
141
143
|
end
|
142
144
|
end
|
143
145
|
|
144
|
-
def saving_instead_of_creating?
|
145
|
-
@identity.respond_to?(:save) && @identity.respond_to?(:persisted?)
|
146
|
-
end
|
147
|
-
|
148
146
|
# Validates the model before it is persisted
|
149
147
|
#
|
150
148
|
# @return [truthy or falsey] :on_validation option is truthy or falsey
|
@@ -177,17 +175,6 @@ module OmniAuth
|
|
177
175
|
registration_failure(options[:registration_failure_message])
|
178
176
|
end
|
179
177
|
end
|
180
|
-
|
181
|
-
def deprecated_registration(attributes)
|
182
|
-
warn <<~CREATEDEP
|
183
|
-
[DEPRECATION] Please define '#{model.class}#save'.
|
184
|
-
Behavior based on '#{model.class}.create' will be removed in omniauth-identity v4.0.
|
185
|
-
See lib/omniauth/identity/model.rb
|
186
|
-
CREATEDEP
|
187
|
-
@identity = model.create(attributes)
|
188
|
-
env['omniauth.identity'] = @identity
|
189
|
-
registration_result
|
190
|
-
end
|
191
178
|
end
|
192
179
|
end
|
193
180
|
end
|